Skip to content

Commit e66ec8d

Browse files
committed
src/goDebugConfiguration: enable dlv-dap for local debugging
And, mark dlv-dap as an important tool (we will need it instead of dlv) Updates #1657 Change-Id: Id0a9b9c287c64958871ac81b42c80b8844dcfab7 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/339094 Trust: Hyang-Ah Hana Kim <[email protected]> Run-TryBot: Hyang-Ah Hana Kim <[email protected]> TryBot-Result: kokoro <[email protected]> Reviewed-by: Suzy Mueller <[email protected]>
1 parent 7502135 commit e66ec8d

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

src/goDebugConfiguration.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@ import {
1818
promptForUpdatingTool,
1919
shouldUpdateTool
2020
} from './goInstallTools';
21-
import { isInPreviewMode } from './goLanguageServer';
2221
import { packagePathToGoModPathMap } from './goModules';
2322
import { getTool, getToolAtVersion } from './goTools';
2423
import { pickProcess, pickProcessByName } from './pickProcess';
2524
import { getFromGlobalState, updateGlobalState } from './stateUtils';
26-
import { getBinPath, getGoVersion, getWorkspaceFolderPath, resolvePath } from './util';
25+
import { getBinPath, getGoVersion } from './util';
2726
import { parseEnvFiles } from './utils/envUtils';
2827
import { resolveHomeDir } from './utils/pathUtils';
2928

@@ -155,10 +154,8 @@ export class GoDebugConfigurationProvider implements vscode.DebugConfigurationPr
155154
}
156155
}
157156
if (!debugConfiguration['debugAdapter']) {
158-
// for nightly/dev mode, default to dlv-dap.
159-
// TODO(hyangah): when we switch the stable version's default to 'dlv-dap', adjust this.
160-
debugConfiguration['debugAdapter'] =
161-
isInPreviewMode() && debugConfiguration['mode'] !== 'remote' ? 'dlv-dap' : 'legacy';
157+
// for local mode, default to dlv-dap.
158+
debugConfiguration['debugAdapter'] = debugConfiguration['mode'] !== 'remote' ? 'dlv-dap' : 'legacy';
162159
}
163160
if (debugConfiguration['debugAdapter'] === 'dlv-dap' && debugConfiguration['mode'] === 'remote') {
164161
this.showWarning(

src/goToolsInformation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ export const allToolsInformation: { [key: string]: Tool } = {
220220
importPath: 'github.com/go-delve/delve/cmd/dlv',
221221
modulePath: 'github.com/go-delve/delve',
222222
replacedByGopls: false,
223-
isImportant: false,
223+
isImportant: true,
224224
description: 'Go debugger (Delve built for DAP experiment)',
225225
defaultVersion: 'master', // Always build from the master.
226226
minimumGoVersion: semver.coerce('1.14'), // last 3 versions per delve policy

test/integration/goDebugConfiguration.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ suite('Debug Configuration Auto Mode', () => {
575575

576576
suite('Debug Configuration Default DebugAdapter', () => {
577577
const debugConfigProvider = new GoDebugConfigurationProvider();
578-
test(`default debugAdapter when isInPreviewMode=${isInPreviewMode()} should be 'dlv-dap'`, () => {
578+
test("default debugAdapter should be 'dlv-dap'", () => {
579579
const config = {
580580
name: 'Launch',
581581
type: 'go',
@@ -586,8 +586,7 @@ suite('Debug Configuration Default DebugAdapter', () => {
586586

587587
debugConfigProvider.resolveDebugConfiguration(undefined, config);
588588
const resolvedConfig = config as any;
589-
const want = isInPreviewMode() ? 'dlv-dap' : 'legacy';
590-
assert.strictEqual(resolvedConfig['debugAdapter'], want);
589+
assert.strictEqual(resolvedConfig['debugAdapter'], 'dlv-dap');
591590
});
592591

593592
test("default debugAdapter for remote mode should be always 'legacy'", () => {

0 commit comments

Comments
 (0)