vscode launch.json 模板备忘

Lex个人随想乡 / 2024-09-05 / 原文

{
    // 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 envionment variables here.
            },
            "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
        }
    ]
}