Skip to content

Commit 59e1356

Browse files
committed
src/goMain: try both gc_details and gopls_gc_details
gopls 0.5.2 will change the command name. During transition, try both commands. Once 0.5.2 is released, we will change the order of tries. And, eventually we will stop using gc_details. Change-Id: I0cbce849108ad19e45dd4e6b21504788643d70eb Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/262497 Trust: Hyang-Ah Hana Kim <[email protected]> Trust: Peter Weinberger <[email protected]> Run-TryBot: Hyang-Ah Hana Kim <[email protected]> TryBot-Result: kokoro <[email protected]> Reviewed-by: Peter Weinberger <[email protected]>
1 parent 26d2a33 commit 59e1356

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/goMain.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
'use strict';
88

99
import * as path from 'path';
10+
import { commands } from 'vscode';
1011
import vscode = require('vscode');
1112
import { extensionId } from './const';
1213
import { browsePackages } from './goBrowsePackage';
@@ -459,7 +460,13 @@ export function activate(ctx: vscode.ExtensionContext) {
459460
vscode.window.showErrorMessage('"Go: Toggle gc details" command cannot run when no Go file is open.');
460461
return;
461462
}
462-
vscode.commands.executeCommand('gc_details', doc);
463+
vscode.commands.executeCommand('gc_details', doc)
464+
.then(undefined, (reason0) => {
465+
vscode.commands.executeCommand('gopls_gc_details', doc)
466+
.then(undefined, (reason1) => {
467+
vscode.window.showErrorMessage(`"Go: Toggle gc details" command failed: gc_details:${reason0} gopls_gc_details:${reason1}`);
468+
});
469+
});
463470
}));
464471

465472
ctx.subscriptions.push(

0 commit comments

Comments
 (0)