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

Commit

Permalink
show warning when using deprecated launch-remote
Browse files Browse the repository at this point in the history
  • Loading branch information
jhendrixMSFT committed Jun 12, 2019
1 parent ed83584 commit 5402218
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/goDebugConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import vscode = require('vscode');
import path = require('path');
import { getCurrentGoPath, getToolsEnvVars, sendTelemetryEvent, getBinPath } from './util';
import { promptForMissingTool } from './goInstallTools';
import { getFromGlobalState, updateGlobalState } from './stateUtils';

export class GoDebugConfigurationProvider implements vscode.DebugConfigurationProvider {

Expand Down Expand Up @@ -103,6 +104,16 @@ export class GoDebugConfigurationProvider implements vscode.DebugConfigurationPr
}
debugConfiguration['currentFile'] = activeEditor && activeEditor.document.languageId === 'go' && activeEditor.document.fileName;

const neverAgain = { title: 'Don\'t Show Again' };
const ignoreWarningKey = 'ignoreDebugLaunchRemoteWarning';
const ignoreWarning = getFromGlobalState(ignoreWarningKey);
if (ignoreWarning !== true && debugConfiguration.request === 'launch' && debugConfiguration['mode'] === 'remote') {
vscode.window.showWarningMessage('Request type of \'launch\' with mode \'remote\' is deprecated, please use request type \'attach\' with mode \'remote\' instead.', neverAgain).then(result => {
if (result === neverAgain) {
updateGlobalState(ignoreWarningKey, true);
}
});
}
return debugConfiguration;
}

Expand Down

0 comments on commit 5402218

Please sign in to comment.