debug: propoagte the unresolvedConfiguration to more than the first restart

fixes #49810
This commit is contained in:
isidor
2018-05-15 11:46:01 +02:00
parent 333a01284e
commit 8c729af886

View File

@@ -690,7 +690,7 @@ export class DebugService implements debug.IDebugService {
this.model.removeWatchExpressions(id);
}
public startDebugging(launch: debug.ILaunch, configOrName?: debug.IConfig | string, noDebug = false): TPromise<void> {
public startDebugging(launch: debug.ILaunch, configOrName?: debug.IConfig | string, noDebug = false, unresolvedConfiguration?: debug.IConfig, ): TPromise<void> {
const sessionId = generateUuid();
this.updateStateAndEmit(sessionId, debug.State.Initializing);
const wrapUpState = () => {
@@ -752,7 +752,7 @@ export class DebugService implements debug.IDebugService {
}
}
return this.startDebugging(launchForName, name, noDebug);
return this.startDebugging(launchForName, name, noDebug, unresolvedConfiguration);
}));
}
if (configOrName && !config) {
@@ -770,7 +770,7 @@ export class DebugService implements debug.IDebugService {
// a no-folder workspace has no launch.config
config = <debug.IConfig>{};
}
const unresolvedConfiguration = deepClone(config);
unresolvedConfiguration = unresolvedConfiguration || deepClone(config);
if (noDebug) {
config.noDebug = true;
@@ -1106,9 +1106,10 @@ export class DebugService implements debug.IDebugService {
let configToUse = session.configuration;
const launch = session.raw.root ? this.configurationManager.getLaunch(session.raw.root.uri) : undefined;
const unresolvedConfiguration = (<Session>session).unresolvedConfiguration;
if (launch) {
const config = launch.getConfiguration(session.configuration.name);
if (config && !equals(config, (<Session>session).unresolvedConfiguration)) {
if (config && !equals(config, unresolvedConfiguration)) {
// Take the type from the session since the debug extension might overwrite it #21316
configToUse = config;
configToUse.type = session.configuration.type;
@@ -1117,7 +1118,7 @@ export class DebugService implements debug.IDebugService {
}
configToUse.__restart = restartData;
this.skipRunningTask = !!restartData;
this.startDebugging(launch, configToUse).then(() => c(null), err => e(err));
this.startDebugging(launch, configToUse, configToUse.noDebug, unresolvedConfiguration).then(() => c(null), err => e(err));
}, 300);
});
}).then(() => {