Код VS: «Параметры отладки свойств не разрешены» - PullRequest
0 голосов
/ 15 октября 2018

Я пытаюсь выучить Python и настроить отладчик Python VS Code, как показано в этом видео: 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.

{
// 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"
    }
]

}

1 Ответ

0 голосов
/ 11 декабря 2018
       "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
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...