Haven't done it in a while and need to re-do after vscode update.
I've got the json debug config setup and can get FC to connect with vscode.
But, vscode can't find FC code. I think this is because with no other configuration it is looking in the directory where the .py file is rather than the freecad directory.
So, I think I need to know how to tell vscode additional search path. But how?
Edit: figured it out.I have in the past setup and been successful at debugging FreeCAD python scripts with vscode.
Haven't done it in a while and need to re-do after vscode update.
I've got the json debug config setup and can get FC to connect with vscode.
But, vscode can't find FC code. I think this is because with no other configuration it is looking in the directory where the .py file is rather than the freecad directory.
So, I think I need to know how to tell vscode additional search path. But how?
Edit: figured it out. vscode is really complaining that it can't find the file being debugged with error: "Breakpoint in non-existant file". Even though the file is open in vscode. But the debug session is actually connecting to FC so the link doesn't find the file being executed.
The launch.json file has to reflect where the file being debugged exists.
Example: File being debugged is /home/mac/SharedData/FC_common/ListSelection-3.py
launch.json needs to specify remoteRoot as follows:
Code: Select all
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Attacher",
"type": "python",
"request": "attach",
"port": 5678,
"host": "localhost",
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "/home/mac/SharedData/FC_common"
}
]
}
]
}