diff --git a/extension/package-lock.json b/extension/package-lock.json index 8486f764ee..2d885cc49f 100644 --- a/extension/package-lock.json +++ b/extension/package-lock.json @@ -1,12 +1,12 @@ { "name": "go", - "version": "0.48.0-dev", + "version": "0.48.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "go", - "version": "0.48.0-dev", + "version": "0.48.0", "license": "MIT", "dependencies": { "diff": "4.0.2", diff --git a/extension/package.json b/extension/package.json index 0d82957105..27f705f17b 100644 --- a/extension/package.json +++ b/extension/package.json @@ -1,7 +1,7 @@ { "name": "go", "displayName": "Go", - "version": "0.48.0-dev", + "version": "0.48.0", "publisher": "golang", "description": "Rich Go language support for Visual Studio Code", "author": { diff --git a/extension/src/goDebugConfiguration.ts b/extension/src/goDebugConfiguration.ts index 94c7e12d9c..243a4a29a3 100644 --- a/extension/src/goDebugConfiguration.ts +++ b/extension/src/goDebugConfiguration.ts @@ -387,9 +387,11 @@ export class GoDebugConfigurationProvider implements vscode.DebugConfigurationPr /** * Calls `dlv substitute-path-guess-helper` to get a set of parameters used by Delve to guess the substitutePath configuration after also examining the executable. * + * Exported for testing. + * * See https://github.com/go-delve/delve/blob/d5fb3bee427202f0d4b1683bf743bfd2adb41757/service/debugger/debugger.go#L2466 */ - private async guessSubstitutePath(): Promise { + public async guessSubstitutePath(): Promise { return new Promise((resolve) => { const child = spawn(getBinPath('dlv'), ['substitute-path-guess-helper']); let stdoutData = ''; diff --git a/extension/test/integration/goDebugConfiguration.test.ts b/extension/test/integration/goDebugConfiguration.test.ts index 877e72cf01..6141764f0c 100644 --- a/extension/test/integration/goDebugConfiguration.test.ts +++ b/extension/test/integration/goDebugConfiguration.test.ts @@ -979,7 +979,7 @@ suite('Debug Configuration Default DebugAdapter', () => { assert.strictEqual(resolvedConfig['debugAdapter'], 'dlv-dap'); }); - test("default debugAdapter for remote mode should be 'legacy' when not in Preview mode", async () => { + test('default debugAdapter for remote mode should be determined by `dlv substitute-path-guess-helper`', async () => { const config = { name: 'Attach', type: 'go', @@ -989,9 +989,14 @@ suite('Debug Configuration Default DebugAdapter', () => { cwd: '/path' }; - const want = extensionInfo.isPreview ? 'dlv-dap' : 'legacy'; await debugConfigProvider.resolveDebugConfiguration(undefined, config); const resolvedConfig = config as any; + + const substitutePathGuess = await debugConfigProvider.guessSubstitutePath(); + let want = 'dlv-dap'; + if (substitutePathGuess === null) { + want = 'legacy'; + } assert.strictEqual(resolvedConfig['debugAdapter'], want); });