vscode 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 FastAPI service",
            "type": "debugpy",
            "request": "launch",
            "module": "uvicorn",
            "env": {
                // Add env variables here.
            },
            "envFile": "${workspaceFolder}/.env",  // the env setting takes precedence over envFile for the same variable name.
            "justMyCode": true,
            "cwd": "/path/to/current/working/directory",
            "args": [
                "main:app",
                "--port",
                "55568"
            ]
        },
        {
            "name": "Python: Debug module",
            "type": "debugpy",
            "request": "launch",
            "module": "hierarchical.module.name",
            "env": {
                // Add envionment variables here.
            },
            "justMyCode": true,
            "cwd": "/path/to/current/working/directory",
        },
        {
            "name": "Python: Current File",
            "type": "debugpy",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "cwd": "${fileDirname}",
            "purpose": [
                "debug-in-terminal"
            ],
            "justMyCode": false
        }
    ]
}
posted @ 2024-09-04 21:49  LexLuc  阅读(17)  评论(0编辑  收藏  举报