简体   繁体   English

为什么 VSCode 不在断点处停止调试?

[英]Why is VSCode not stopping at breakpoints for debugging?

So, I know there is this previous posting about this: Debugger Not Stopping at Breakpoints in VS Code for Python所以,我知道之前有一篇关于这个的帖子: Debugger Not Stopping at Breakpoints in VS Code for Python

However, I'm having the exact same issue on a newer version of VSCode.但是,我在较新版本的 VSCode 上遇到了完全相同的问题。

My setup:我的设置:

  • Manjaro Linux Manjaro Linux
  • Official MS VSCode (1.55.2)官方 MS VSCode (1.55.2)
  • Python Extension added, and mostly at defaults (below are my settings.json settings related to python) Python 添加了扩展,大部分是默认的(下面是我的设置。json 设置与 python 相关)
     "[python]": { "editor.detectIndentation": true, "editor.insertSpaces": true }, "python.autoComplete.addBrackets": true, "python.linting.flake8Args": [ "--ignore=F401,F841,E501,E305,E302" ], "python.linting.flake8Enabled": true, "python.venvPath": "/home/greg/git/code/python/venvs"
  • Here are my launch.json settings:这是我的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": "Python: Debug Current File", "type": "python", "request": "launch", "program": "${file}", "console": "integratedTerminal", "stopOnEntry": true, "justMyCode": false } ] }

Try:尝试:

  1. Remove the launch.json from the project (save it somewhere else in case you need it)从项目中删除launch.json (将其保存在其他地方以备不时之需)
  2. Restart VS Code重启 VS 代码
  3. Try debugging.尝试调试。 If it prompts you for a launch.json , just go with the defaults.如果它提示您launch.json ,只需 go 使用默认值。

If you place breakpoint on BLANK LINE, or a line with only comments it will not work.如果您在空白行或只有注释的行上放置断点,它将不起作用。

Place your breakpoint on a LINE THAT HAS CODE.将断点放在有代码的行上。

You're welcome别客气

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM