提交 77ebba73 编写于 作者: I isidor 提交者: Joao Moreno

debug: do not run prelaunch and postdebug tasks for automtic restarts

fixes #11522
上级 52482cf9
...@@ -83,6 +83,7 @@ export class DebugService implements debug.IDebugService { ...@@ -83,6 +83,7 @@ export class DebugService implements debug.IDebugService {
private breakpointsToSendOnResourceSaved: Set<string>; private breakpointsToSendOnResourceSaved: Set<string>;
private launchJsonChanged: boolean; private launchJsonChanged: boolean;
private firstSessionStart: boolean; private firstSessionStart: boolean;
private skipRunningTask: boolean;
private previousState: debug.State; private previousState: debug.State;
private fetchThreadsSchedulers: Map<string, RunOnceScheduler>; private fetchThreadsSchedulers: Map<string, RunOnceScheduler>;
...@@ -996,7 +997,8 @@ export class DebugService implements debug.IDebugService { ...@@ -996,7 +997,8 @@ export class DebugService implements debug.IDebugService {
} }
private runTask(sessionId: string, root: IWorkspaceFolder, taskName: string): TPromise<ITaskSummary> { private runTask(sessionId: string, root: IWorkspaceFolder, taskName: string): TPromise<ITaskSummary> {
if (!taskName) { if (!taskName || this.skipRunningTask) {
this.skipRunningTask = false;
return TPromise.as(null); return TPromise.as(null);
} }
...@@ -1065,6 +1067,8 @@ export class DebugService implements debug.IDebugService { ...@@ -1065,6 +1067,8 @@ export class DebugService implements debug.IDebugService {
} }
const focusedProcess = this.viewModel.focusedProcess; const focusedProcess = this.viewModel.focusedProcess;
const preserveFocus = focusedProcess && process.getId() === focusedProcess.getId(); const preserveFocus = focusedProcess && process.getId() === focusedProcess.getId();
// Do not run prelaunch and postdebug tasks for automtic restarts
this.skipRunningTask = !!restartData;
return process.session.disconnect(true).then(() => { return process.session.disconnect(true).then(() => {
if (strings.equalsIgnoreCase(process.configuration.type, 'extensionHost') && process.session.root) { if (strings.equalsIgnoreCase(process.configuration.type, 'extensionHost') && process.session.root) {
...@@ -1088,6 +1092,7 @@ export class DebugService implements debug.IDebugService { ...@@ -1088,6 +1092,7 @@ export class DebugService implements debug.IDebugService {
config.noDebug = process.configuration.noDebug; config.noDebug = process.configuration.noDebug;
} }
config.__restart = restartData; config.__restart = restartData;
this.skipRunningTask = !!restartData;
this.startDebugging(launch, config).then(() => c(null), err => e(err)); this.startDebugging(launch, config).then(() => c(null), err => e(err));
}, 300); }, 300);
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册