VS Code:“不允许属性调试选项" [英] VS Code: "Property Debug Options Not Allowed"
问题描述
我正在尝试学习 Python 并设置 VS Code 的 Python 调试器,如本视频所述:https://www.lynda.com/Python-tutorials/Choosing-editor-IDE/661773/707220-4.html
I am trying to learn Python and set up VS Code's Python debugger as this video describes: https://www.lynda.com/Python-tutorials/Choosing-editor-IDE/661773/707220-4.html
但是讲师似乎在使用 VS Code 1.18,而我在使用 1.28.我根据它在视频中的显示方式设置了 launch.json 配置,但是我在debugOptions"下看到一条绿线,上面写着不允许使用属性 debugOptions".任何人都知道我可以如何设置我的环境,使其按照讲师解释的方式工作.我使用的是 Windows 10.
However the instructor seems to be on VS Code 1.18 and I'm on 1.28. I set up the launch.json configuration up to how it appears in the video but I'm getting a green line under "debugOptions" that says "Property debugOptions is not allowed". Anyone know how I can set up my environment so that it works the way the instructor is explaining. I'm on Windows 10.
{
// 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",
"type": "python",
"request": "launch",
"stopOnEntry": true,
"pythonPath": "${config:python.pythonPath}",
"program": "${file}",
"cwd": "",
"env":{},
"envFile": "${workspaceRoot}/.env",
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit",
"RedirectOuput"
]
},
{
"name": "Python: Attach",
"type": "python",
"request": "attach",
"port": 5678,
"host": "localhost"
},
{
"name": "Python: Module",
"type": "python",
"request": "launch",
"module": "enter-your-module-name-here",
"console": "integratedTerminal"
},
{
"name": "Python: Django",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/manage.py",
"console": "integratedTerminal",
"args": [
"runserver",
"--noreload",
"--nothreading"
],
"django": true
},
{
"name": "Python: Flask",
"type": "python",
"request": "launch",
"module": "flask",
"env": {
"FLASK_APP": "app.py"
},
"args": [
"run",
"--no-debugger",
"--no-reload"
],
"jinja": true
},
{
"name": "Python: Current File (External Terminal)",
"type": "python",
"request": "launch",
"program": "",
"console": "externalTerminal"
}
]
}
推荐答案
"name": "Python",
"type": "python",
"request": "launch",
"stopOnEntry": true,
"pythonPath": "${config:python.pythonPath}",
"program": "${file}",
"cwd": "",
"env":{},
"envFile": "${workspaceRoot}/.env",
"console": "none" //add this and go
这篇关于VS Code:“不允许属性调试选项"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!