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

Add option for "Don't Ask Again" while saving the file in debug mode #2906

Merged
merged 1 commit into from
Nov 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 12 additions & 3 deletions src/goMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { GoRunTestCodeLensProvider } from './goRunTestCodelens';
import { showHideStatus } from './goStatus';
import { testAtCursor, testCurrentFile, testCurrentPackage, testPrevious, testWorkspace } from './goTest';
import { vetCode } from './goVet';
import { setGlobalState } from './stateUtils';
import { setGlobalState, getFromGlobalState, updateGlobalState } from './stateUtils';
import { cancelRunningTests, showTestOutput } from './testUtils';
import { cleanupTempDir, disposeTelemetryReporter, getBinPath, getGoConfig, getCurrentGoPath, getExtensionCommands, getGoVersion, getToolsEnvVars, getToolsGopath, getWorkspaceFolderPath, handleDiagnosticErrors, isGoPathSet, sendTelemetryEvent } from './util';

Expand Down Expand Up @@ -275,7 +275,7 @@ export function activate(ctx: vscode.ExtensionContext): void {
}
if (e.affectsConfiguration('go.toolsEnvVars')) {
const env = getToolsEnvVars();
if (GO111MODULE !== env['GO111MODULE']) {
if (GO111MODULE !== env['GO111MODULE']) {
const reloadMsg = 'Reload VS Code window so that the Go tools can respect the change to GO111MODULE';
vscode.window.showInformationMessage(reloadMsg, 'Reload').then((selected) => {
if (selected === 'Reload') {
Expand Down Expand Up @@ -393,7 +393,16 @@ function addOnSaveTextDocumentListeners(ctx: vscode.ExtensionContext) {
return;
}
if (vscode.debug.activeDebugSession) {
vscode.window.showWarningMessage('A debug session is currently active. Changes to your Go files may result in unexpected behaviour.');
const neverAgain = { title: 'Don\'t Show Again' };
const ignoreActiveDebugWarningKey = 'ignoreActiveDebugWarningKey';
const ignoreActiveDebugWarning = getFromGlobalState(ignoreActiveDebugWarningKey);
if (!ignoreActiveDebugWarning) {
vscode.window.showWarningMessage('A debug session is currently active. Changes to your Go files may result in unexpected behaviour.', neverAgain).then(result => {
if (result === neverAgain) {
updateGlobalState(ignoreActiveDebugWarningKey, true);
}
});
}
}
if (vscode.window.visibleTextEditors.some(e => e.document.fileName === document.fileName)) {
runBuilds(document, getGoConfig(document.uri));
Expand Down