I setup a while ago debugging for a small python program, which I developed using docker.
So I used Python: Remote Attach
, as shown in the official documentation. This worked for me.
Later I started having one workspace for my multiple other project I developed.
However now debugpy
gets confused and gives me the following error message:
pydev debugger: unable to find translation for: "/path/to/other/php-project/random-file.php" in ["/path/to/the/to/be/debugged/my-python-project", "/path/to/the/to/be/debugged/my-python-project"] (please revise your path mappings).
I really don't understand, why it picks this random php file from the other project.
As I mentioned I use the configuration from vs code official documentation.
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Remote Attach",
"type": "debugpy",
"request": "attach",
"connect": {
"host": "localhost",
"port": 5678
},
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "."
}
],
"justMyCode": true
}
]
}
I already tried changing local root in the path mapping: "localRoot": "${workspaceFolder}/my-python-project"
. This did not change anything.
When I open the project only as folder without the workspace, debugging works as before.
I had an debugpoint enabled on the file from the other php project. After closing it, everything worked as before.