Check save settings before debug restart (#154206)

* Fix bug: Files automatically saved when restarting debugger, even though it is set not to
Fixes #149885
This commit is contained in:
Andrea Mah
2022-07-07 18:01:33 +00:00
committed by GitHub
parent 1cc52ae410
commit 368400c190
6 changed files with 24 additions and 7 deletions
@@ -223,6 +223,7 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape, IDeb
const folderUri = folder ? uri.revive(folder) : undefined;
const launch = this.debugService.getConfigurationManager().getLaunch(folderUri);
const parentSession = this.getSession(options.parentSessionID);
const saveBeforeStart = typeof options.suppressSaveBeforeStart === 'boolean' ? !options.suppressSaveBeforeStart : undefined;
const debugOptions: IDebugSessionOptions = {
noDebug: options.noDebug,
parentSession,
@@ -230,11 +231,11 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape, IDeb
repl: options.repl,
compact: options.compact,
debugUI: options.debugUI,
compoundRoot: parentSession?.compoundRoot
compoundRoot: parentSession?.compoundRoot,
saveBeforeStart: saveBeforeStart
};
try {
const saveBeforeStart = typeof options.suppressSaveBeforeStart === 'boolean' ? !options.suppressSaveBeforeStart : undefined;
return this.debugService.startDebugging(launch, nameOrConfig, debugOptions, saveBeforeStart);
return this.debugService.startDebugging(launch, nameOrConfig, debugOptions);
} catch (err) {
throw new ErrorNoTelemetry(err && err.message ? err.message : 'cannot start debugging');
}