fix(debug): prefer dlv for go directory launches
Prefer directory-capable adapters when selecting a launch adapter for a resolved directory program. This keeps Go package directories on dlv in mixed projects that also expose native-debugger root markers such as a Makefile, instead of selecting gdb/lldb-dap first and rejecting the directory during validation. Added a regression test covering a Go module with both go.mod and Makefile plus local dlv/gdb adapter shims. Fixes #2020
This commit is contained in:
@@ -687,7 +687,7 @@ export class DebugTool implements AgentTool<typeof debugSchema, DebugToolDetails
|
||||
const commandCwd = params.cwd ? resolveToCwd(params.cwd, this.session.cwd) : this.session.cwd;
|
||||
const program = resolveToCwd(params.program, commandCwd);
|
||||
const programKind = await classifyLaunchProgram(program);
|
||||
const adapter = selectLaunchAdapter(program, commandCwd, params.adapter);
|
||||
const adapter = selectLaunchAdapter(program, commandCwd, params.adapter, programKind);
|
||||
if (!adapter) {
|
||||
if (params.adapter === "debugpy") {
|
||||
throw new ToolError("adapter 'debugpy' is not available: python not found in PATH");
|
||||
|
||||
Reference in New Issue
Block a user