Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
Show warning message when modifying debugged file
Browse files Browse the repository at this point in the history
  • Loading branch information
Hary Prabowo committed Jul 15, 2019
1 parent 4b516f9 commit 4c9cb24
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/goMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import { installCurrentPackage } from './goInstall';
import { setGlobalState } from './stateUtils';
import { ProvideTypeDefinitionSignature } from 'vscode-languageclient/lib/typeDefinition';
import { ProvideImplementationSignature } from 'vscode-languageclient/lib/implementation';
import { DebugSession } from 'vscode-debugadapter';

export let buildDiagnosticCollection: vscode.DiagnosticCollection;
export let lintDiagnosticCollection: vscode.DiagnosticCollection;
Expand Down Expand Up @@ -627,6 +628,11 @@ function addOnSaveTextDocumentListeners(ctx: vscode.ExtensionContext) {
if (document.languageId !== 'go') {
return;
}
if (vscode.debug.activeDebugSession) {
vscode.window.showWarningMessage('Changes are not allowed while code is running');

return;
}
if (vscode.window.visibleTextEditors.some(e => e.document.fileName === document.fileName)) {
runBuilds(document, vscode.workspace.getConfiguration('go', document.uri));
}
Expand Down

0 comments on commit 4c9cb24

Please sign in to comment.