1745529368
The debug tool ran validateLaunchProgram before adapter selection and rejected any directory program with `launch program resolves to a directory`, while dlv's default `mode=debug` requires a Go package path (a directory or .go source file). Every Go-module launch failed: passing the module dir was rejected outright, and passing the compiled binary failed at dlv with `not a valid go module`. - Add `acceptsDirectoryProgram` to DapAdapterConfig/DapResolvedAdapter and flag dlv in dap/defaults.json. - In DebugTool.execute(launch), resolve the adapter first, then call validateLaunchProgram with the resolved adapter — the directory rejection only fires when the adapter does not advertise the flag. - Add resolveLaunchOverrides in dap/config.ts: for dlv, derive `mode` from the program shape (directory or .go file → debug; other file → exec). Plumbed through DapLaunchSessionOptions.extraLaunchArguments and spread between adapter.launchDefaults and the hard-coded launch fields in session.ts. - Refresh tests: cover the no-dir-support adapter rejection, dlv on a package directory keeping mode=debug, and dlv on a binary switching to mode=exec. Fixes #2020
213 lines
5.0 KiB
JSON
213 lines
5.0 KiB
JSON
{
|
|
"gdb": {
|
|
"command": "gdb",
|
|
"args": ["-i", "dap"],
|
|
"languages": ["c", "cpp", "rust"],
|
|
"fileTypes": [".c", ".cc", ".cpp", ".cxx", ".h", ".hh", ".hpp", ".hxx", ".rs"],
|
|
"rootMarkers": ["Makefile", "CMakeLists.txt", "Cargo.toml", "compile_commands.json"],
|
|
"launchDefaults": {
|
|
"request": "launch",
|
|
"stopOnEntry": true,
|
|
"stopAtBeginningOfMainSubprogram": true
|
|
},
|
|
"attachDefaults": {
|
|
"request": "attach"
|
|
}
|
|
},
|
|
"lldb-dap": {
|
|
"command": "lldb-dap",
|
|
"args": [],
|
|
"languages": ["c", "cpp", "objc", "swift", "rust", "zig"],
|
|
"fileTypes": [".c", ".cc", ".cpp", ".cxx", ".m", ".mm", ".swift", ".rs", ".zig"],
|
|
"rootMarkers": ["Package.swift", "Cargo.toml", "Makefile", "CMakeLists.txt", "build.zig"],
|
|
"launchDefaults": {
|
|
"request": "launch",
|
|
"stopOnEntry": true
|
|
},
|
|
"attachDefaults": {
|
|
"request": "attach"
|
|
}
|
|
},
|
|
"codelldb": {
|
|
"command": "codelldb",
|
|
"args": ["--port", "0"],
|
|
"languages": ["c", "cpp", "rust", "zig"],
|
|
"fileTypes": [".c", ".cc", ".cpp", ".cxx", ".rs", ".zig"],
|
|
"rootMarkers": ["Cargo.toml", "CMakeLists.txt", "Makefile", "compile_commands.json", "build.zig"],
|
|
"launchDefaults": {
|
|
"request": "launch",
|
|
"stopOnEntry": true
|
|
},
|
|
"attachDefaults": {
|
|
"request": "attach"
|
|
}
|
|
},
|
|
"debugpy": {
|
|
"command": "python",
|
|
"args": ["-m", "debugpy.adapter"],
|
|
"languages": ["python"],
|
|
"fileTypes": [".py"],
|
|
"rootMarkers": ["pyproject.toml", "setup.py", "requirements.txt", "Pipfile"],
|
|
"launchDefaults": {
|
|
"request": "launch",
|
|
"justMyCode": false,
|
|
"stopOnEntry": true
|
|
},
|
|
"attachDefaults": {
|
|
"request": "attach",
|
|
"justMyCode": false
|
|
}
|
|
},
|
|
"dlv": {
|
|
"command": "dlv",
|
|
"args": ["dap"],
|
|
"connectMode": "socket",
|
|
"languages": ["go"],
|
|
"fileTypes": [".go"],
|
|
"rootMarkers": ["go.mod", "go.sum"],
|
|
"acceptsDirectoryProgram": true,
|
|
"launchDefaults": {
|
|
"request": "launch",
|
|
"mode": "debug",
|
|
"stopOnEntry": true
|
|
},
|
|
"attachDefaults": {
|
|
"request": "attach",
|
|
"mode": "local"
|
|
}
|
|
},
|
|
"js-debug-adapter": {
|
|
"command": "js-debug-adapter",
|
|
"args": [],
|
|
"languages": ["javascript", "typescript"],
|
|
"fileTypes": [".js", ".jsx", ".ts", ".tsx", ".mjs", ".cjs"],
|
|
"rootMarkers": ["package.json", "tsconfig.json", "jsconfig.json"],
|
|
"launchDefaults": {
|
|
"request": "launch",
|
|
"type": "pwa-node",
|
|
"stopOnEntry": true
|
|
},
|
|
"attachDefaults": {
|
|
"request": "attach",
|
|
"type": "pwa-node"
|
|
}
|
|
},
|
|
"netcoredbg": {
|
|
"command": "netcoredbg",
|
|
"args": ["--interpreter=vscode"],
|
|
"languages": ["csharp", "fsharp"],
|
|
"fileTypes": [".cs", ".csx", ".fs", ".fsx"],
|
|
"rootMarkers": ["*.sln", "*.csproj", "*.fsproj", "global.json"],
|
|
"launchDefaults": {
|
|
"request": "launch",
|
|
"stopAtEntry": true
|
|
},
|
|
"attachDefaults": {
|
|
"request": "attach"
|
|
}
|
|
},
|
|
"kotlin-debug-adapter": {
|
|
"command": "kotlin-debug-adapter",
|
|
"args": [],
|
|
"languages": ["kotlin"],
|
|
"fileTypes": [".kt", ".kts"],
|
|
"rootMarkers": ["build.gradle", "build.gradle.kts", "pom.xml", "settings.gradle", "settings.gradle.kts"],
|
|
"launchDefaults": {
|
|
"request": "launch",
|
|
"mainClass": "",
|
|
"projectRoot": ""
|
|
},
|
|
"attachDefaults": {
|
|
"request": "attach"
|
|
}
|
|
},
|
|
"rdbg": {
|
|
"command": "rdbg",
|
|
"args": ["--open", "--command", "--"],
|
|
"languages": ["ruby"],
|
|
"fileTypes": [".rb", ".rake", ".gemspec"],
|
|
"rootMarkers": ["Gemfile", "Rakefile", ".ruby-version"],
|
|
"launchDefaults": {
|
|
"request": "launch",
|
|
"type": "rdbg"
|
|
},
|
|
"attachDefaults": {
|
|
"request": "attach",
|
|
"type": "rdbg"
|
|
}
|
|
},
|
|
"php-debug-adapter": {
|
|
"command": "php-debug-adapter",
|
|
"args": [],
|
|
"languages": ["php"],
|
|
"fileTypes": [".php", ".phtml"],
|
|
"rootMarkers": ["composer.json", "composer.lock"],
|
|
"launchDefaults": {
|
|
"request": "launch",
|
|
"stopOnEntry": true
|
|
},
|
|
"attachDefaults": {
|
|
"request": "attach"
|
|
}
|
|
},
|
|
"bash-debug-adapter": {
|
|
"command": "bash-debug-adapter",
|
|
"args": [],
|
|
"languages": ["bash", "shell"],
|
|
"fileTypes": [".sh", ".bash"],
|
|
"rootMarkers": [".git"],
|
|
"launchDefaults": {
|
|
"request": "launch",
|
|
"type": "bashdb",
|
|
"pathBashdb": "bashdb",
|
|
"pathBash": "bash"
|
|
},
|
|
"attachDefaults": {
|
|
"request": "attach"
|
|
}
|
|
},
|
|
"dart-debug-adapter": {
|
|
"command": "dart",
|
|
"args": ["debug_adapter"],
|
|
"languages": ["dart"],
|
|
"fileTypes": [".dart"],
|
|
"rootMarkers": ["pubspec.yaml", "pubspec.lock"],
|
|
"launchDefaults": {
|
|
"request": "launch",
|
|
"stopOnEntry": true
|
|
},
|
|
"attachDefaults": {
|
|
"request": "attach"
|
|
}
|
|
},
|
|
"flutter-debug-adapter": {
|
|
"command": "dart",
|
|
"args": ["debug_adapter", "--flutter-sdk-path", ""],
|
|
"languages": ["dart"],
|
|
"fileTypes": [".dart"],
|
|
"rootMarkers": ["pubspec.yaml", "android", "ios", "lib/main.dart"],
|
|
"launchDefaults": {
|
|
"request": "launch"
|
|
},
|
|
"attachDefaults": {
|
|
"request": "attach"
|
|
}
|
|
},
|
|
"elixir-ls-debugger": {
|
|
"command": "elixir-ls-debugger",
|
|
"args": [],
|
|
"languages": ["elixir"],
|
|
"fileTypes": [".ex", ".exs", ".heex", ".eex"],
|
|
"rootMarkers": ["mix.exs", "mix.lock"],
|
|
"launchDefaults": {
|
|
"request": "launch",
|
|
"type": "mix_task",
|
|
"task": "run",
|
|
"stopOnEntry": true
|
|
},
|
|
"attachDefaults": {
|
|
"request": "attach"
|
|
}
|
|
}
|
|
}
|