diff --git a/src/debugAdapter/goDebug.ts b/src/debugAdapter/goDebug.ts index a9a309ef4..98bdbd0d4 100644 --- a/src/debugAdapter/goDebug.ts +++ b/src/debugAdapter/goDebug.ts @@ -435,6 +435,7 @@ class Delve { runOptions.cwd = program; runArgs.push('.'); } else { + runOptions.cwd = dirname; runArgs.push(program); } if (launchArgs.args) { diff --git a/src/goDebugConfiguration.ts b/src/goDebugConfiguration.ts index 367fd2815..f9fe07cbc 100644 --- a/src/goDebugConfiguration.ts +++ b/src/goDebugConfiguration.ts @@ -47,13 +47,13 @@ export class GoDebugConfigurationProvider implements vscode.DebugConfigurationPr return; } - debugConfiguration = { + debugConfiguration = Object.assign(debugConfiguration || {}, { name: 'Launch', type: 'go', request: 'launch', mode: 'auto', program: activeEditor.document.fileName - }; + }); } debugConfiguration['packagePathToGoModPathMap'] = packagePathToGoModPathMap;