I have a Python project with multiple files/modules, that I'm trying to debug. I have the Python extension installed, and I put a bunch of breakpoints in - some in the current file and some in another file/module. Breakpoints in the current file are working fine, however, the breakpoints in other file(s) are not. Is there a step I'm missing in setting the debugger up? Couldn't find anything on Google for this specific problem, the tutorials only show debugging in one file and that is working fine. If I try to right click and go to the definition of any function in another module, that also works fine so the project is aware of the multiple modules (I have the whole directory open in VS Code), the breakpoints don't.
To debug multiple services at the same timeOpen the folder corresponding to your first service in VS Code. In VS Code, select File > Add Folder to Workspace…, and pick the folder corresponding to your other service.
Press F3 and then press F9 to add a breakpoint.
Breakpoints can be toggled by clicking on the editor margin or using F9 on the current line. Finer breakpoint control (enable/disable/reapply) can be done in the Run and Debug view's BREAKPOINTS section.
Multi-selection#Use the Ctrl/Cmd key with click to select individual files and Shift + click to select a range. If you select two items, you can now use the context menu Compare Selected command to quickly diff two files.
Ran into the same issue. In case you still need to know, this is how I resolved it.
{
// 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: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
}
]
}
{
// 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: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": false
}
]
}
A screenshot of what the debug screen configuration should now look like:
You can create different configs if you don't want to debug other modules or do things as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With