Skip to content

Commit e13228d

Browse files
committed
src/goMain: do not show warning if the active debug session is not ours
In multi-language project, we probably don't need to warn about go file editing just because a debugging session is active. Fixes #892 Change-Id: I2c649537605e767fe92183687a714d6193f1abf8 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/269137 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 68a73a6 commit e13228d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/goMain.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ export function activate(ctx: vscode.ExtensionContext) {
217217
ctx.subscriptions.push(
218218
vscode.commands.registerCommand('go.debug.cursor', (args) => {
219219
if (vscode.debug.activeDebugSession) {
220-
vscode.window.showErrorMessage('Debug session has already been started.');
220+
vscode.window.showErrorMessage('Debug session has already been started');
221221
return;
222222
}
223223
const goConfig = getGoConfig();
@@ -596,7 +596,8 @@ function addOnSaveTextDocumentListeners(ctx: vscode.ExtensionContext) {
596596
if (document.languageId !== 'go') {
597597
return;
598598
}
599-
if (vscode.debug.activeDebugSession) {
599+
const session = vscode.debug.activeDebugSession;
600+
if (session && (session.type === 'go' || session.type === 'godlvdap')) {
600601
const neverAgain = { title: `Don't Show Again` };
601602
const ignoreActiveDebugWarningKey = 'ignoreActiveDebugWarningKey';
602603
const ignoreActiveDebugWarning = getFromGlobalState(ignoreActiveDebugWarningKey);

0 commit comments

Comments
 (0)