From 09dcadacf0311d3b519c5a143cdfddb6b7c56359 Mon Sep 17 00:00:00 2001 From: Hongxiang Jiang Date: Fri, 27 Jun 2025 03:41:08 +0000 Subject: [PATCH 1/2] [release-v0.48]extension/test/integration: update debug config for remote mode CL 643280 changed the behavior of debug adapter in remote mode from always "legacy" to the result from command `dlv substitute-path-guess-helper`. This CL calls the method to find the right return value and test the debug adapter with the command return. In master branch, the integration test is running against preview version of extension, so the debug adapter is always "dlv-dap" regardless of the command return. So this test is not captured in the master branch. Change-Id: I5ce6e1040fa16f10b038265d7e0ab7a884a99141 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/684475 kokoro-CI: kokoro Reviewed-by: Robert Findley Reviewed-by: Madeline Kalil LUCI-TryBot-Result: Go LUCI --- extension/src/goDebugConfiguration.ts | 4 +++- extension/test/integration/goDebugConfiguration.test.ts | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) 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); }); From 93482a43028147395301d710429902161658a264 Mon Sep 17 00:00:00 2001 From: Gopher Robot Date: Thu, 26 Jun 2025 11:54:22 -0700 Subject: [PATCH 2/2] [release-v0.48]extension/package.json: update version to 0.48.0 This is an automated CL which updates the package.json and package-lock.json. Change-Id: Ic886e4815b5f58529f822efad82d808347b4caa0 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/684136 kokoro-CI: kokoro Reviewed-by: Madeline Kalil Reviewed-by: Hongxiang Jiang LUCI-TryBot-Result: Go LUCI Auto-Submit: Hongxiang Jiang --- extension/package-lock.json | 4 ++-- extension/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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": {