Refine failure scenario. (#244)
This commit is contained in:
parent
820642f7bb
commit
ef4de79c17
|
@ -5,7 +5,11 @@ import * as vscode from "vscode";
|
||||||
|
|
||||||
const suppressedReasons: Set<string> = new Set();
|
const suppressedReasons: Set<string> = new Set();
|
||||||
|
|
||||||
const NOT_SHOW_AGAIN: string = "Not show again";
|
const YES_BUTTON: string = "Yes";
|
||||||
|
|
||||||
|
const NO_BUTTON: string = "No";
|
||||||
|
|
||||||
|
const NEVER_BUTTON: string = "Not show again";
|
||||||
|
|
||||||
const JAVA_LANGID: string = "java";
|
const JAVA_LANGID: string = "java";
|
||||||
|
|
||||||
|
@ -42,9 +46,13 @@ export function initializeHotCodeReplace(context: vscode.ExtensionContext) {
|
||||||
|
|
||||||
if (customEvent.body.changeType === HcrChangeType.ERROR || customEvent.body.changeType === HcrChangeType.WARNING) {
|
if (customEvent.body.changeType === HcrChangeType.ERROR || customEvent.body.changeType === HcrChangeType.WARNING) {
|
||||||
if (!suppressedReasons.has(customEvent.body.message)) {
|
if (!suppressedReasons.has(customEvent.body.message)) {
|
||||||
vscode.window.showInformationMessage(`Hot code replace failed - ${customEvent.body.message}`, NOT_SHOW_AGAIN).then((res) => {
|
vscode.window.showInformationMessage(
|
||||||
if (res === NOT_SHOW_AGAIN) {
|
`Hot code replace failed - ${customEvent.body.message}. Would you like to restart the debug session?`,
|
||||||
|
YES_BUTTON, NO_BUTTON, NEVER_BUTTON).then((res) => {
|
||||||
|
if (res === NEVER_BUTTON) {
|
||||||
suppressedReasons.add(customEvent.body.message);
|
suppressedReasons.add(customEvent.body.message);
|
||||||
|
} else if (res === YES_BUTTON) {
|
||||||
|
vscode.commands.executeCommand("workbench.action.debug.restart");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue