I use this configuration and work only if I insert this two line
// "stopOnEntry": true
// "justMyCode": false
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Debug Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"stopOnEntry": true,
"justMyCode": false
},
]
}
Answer from Marco Graziano on Stack OverflowI use this configuration and work only if I insert this two line
// "stopOnEntry": true
// "justMyCode": false
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Debug Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"stopOnEntry": true,
"justMyCode": false
},
]
}
If you have upgraded your .Net Core SDK recently, just update netcoreappX.X
"program": "${workspaceFolder}/CommunityBot/bin/Debug/netcoreappX.X/CommunityBot.dll"
in launch.json file.
Check your .Net Core SDK version by dotnet --version
I'm new to using VS Code as I¡ve always used Eclipse IDE. I'm trying to debug my java file in which I've created a breakpoint, but the debugger just runs the code as if there wasn't such breakpoint..
I've seen some other people struggle with this, so here's my launch.json:
{
// 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": "Java",
"type": "java",
"request": "launch",
"stopOnEntry": true,
"jdkPath": "${env:JAVA_HOME}/bin",
"cwd": "${fileDirname}",
"startupClass": "${fileBasenameNoExtension}",
"classpath": [
".",
"${fileDirname}"
]
},
{
"name": "Java Console App",
"type": "java",
"request": "launch",
"stopOnEntry": true,
"jdkPath": "${env:JAVA_HOME}/bin",
"cwd": "${fileDirname}",
"startupClass": "${fileBasenameNoExtension}",
"classpath": [
".",
"${fileDirname}"
],
"externalConsole": true
},
{
"type": "java",
"name": "Current File",
"request": "launch",
"mainClass": "${file}"
},
{
"type": "java",
"name": "Numeros",
"request": "launch",
"mainClass": "Numeros",
"projectName": "progra_4bad0bd0"
}
]
}Thanks in advance
VSCode Breakpoint not hitting/stopping when run in debugger mode - Golang
Debugging tests is not stopping on breakpoint
Debugger in vs-code does not stop at breakpoint but elsewhere
python - VSCode: Why isn't debugger stopping at breakpoints? - Stack Overflow
Setting "justMyCode": false makes it stop at breakpoint:
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Debug Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"stopOnEntry": true,
"justMyCode": false
},
]
}
If you're using a pytest-cov module you might also wanna have a look at pytest configuration settings note:
Note If you have the
pytest-covcoverage module installed, VS Code doesn't stop at breakpoints while debugging becausepytest-covis using the same technique to access the source code being run. To prevent this behavior, include--no-covinpytestArgswhen debugging tests, for example by adding"env": {"PYTEST_ADDOPTS": "--no-cov"}to your debug configuration.
See an example configuration file (launch.json) below:
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Tests",
"type": "python",
"request": "test",
"console": "integratedTerminal",
"justMyCode": false,
"env": {"PYTEST_ADDOPTS": "--no-cov"}
}
]
}
Try this configuration in your launch file:
{
"name": "Attach to Process",
"type": "node",
"protocol": "inspector",
"request": "attach",
"stopOnEntry": false,
"port": 5858,
"localRoot": "${workspaceRoot}",
"remoteRoot": "/somepath/myprojectroot",
"sourceMaps": true
}
Make sure the remoteRoot is correct path, otherwise it won't know where to look for the source files.
On the VSCode settings search for 'debug javascript use preview', and then disable it. It should now bound all breakpoints.
I went trough something similar recently and found this page when searching the error.
Unlike you, I didn't want to run coverage tests in VS Code, so I could simply disable it in settings.json passing the --no-cov argument:
"python.testing.pytestArgs": [
"--import-mode=importlib",
"--no-cov"
]
This solved the debugger not stopping at breakpoints problem for me.
You could try to use the following codes in your launch.json:
{
"name": "Python: Debug Tests",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"purpose": [
"debug-test"
],
"console": "integratedTerminal",
"justMyCode": true,
"env": {
"ON_HEROKU": "0",
"PYTEST_ADDOPTS": "-c pytest-debug.ini",
"ECHO_SQL_QUERIES": "1"
},
}
pytest-debug.ini is a separate configuration file for debugging. This file should be similar to your pytest.ini file, but without the addopts line:
[pytest]
env =
TESTING=true
ENV=local
This way, when you're debugging your tests, pytest will use the pytest-debug.ini configuration file.
This post was mass deleted and anonymized with Redact
lock relieved tie boast hat fearless heavy act fear point
I had the same problem and it turn out that it was due to having installed pytest-cov.
The solution is to add the argument --no-cov to python.testing.pytestArgs, as it is pointed in the documentation
Credits to this asnwer for getting me in the right track.
You will need to change your setting "justMyCode" to false for breakpoints to work in vscode.
More can be read Here