Fixes #35022: Transition from task 0.1.0 to 2.0.0 produces errors

This commit is contained in:
Dirk Baeumer 2017-09-27 11:48:00 +02:00
parent 06a2f97a23
commit 29f17e701a

View file

@ -614,6 +614,7 @@ class TaskService extends EventEmitter implements ITaskService {
this._configHasErrors = false;
this._workspaceTasksPromise = undefined;
this._taskSystem = undefined;
this._taskSystemListeners = [];
this._outputChannel = this.outputService.getChannel(TaskService.OutputChannelId);
this._providers = new Map<number, ITaskProvider>();
@ -625,21 +626,26 @@ class TaskService extends EventEmitter implements ITaskService {
this._outputChannel.clear();
}
let folderSetup = this.computeWorkspaceFolderSetup();
if (this.executionEngine !== folderSetup[1] && this._taskSystem && this._taskSystem.getActiveTasks().length > 0) {
this.messageService.show(
Severity.Info,
{
message: nls.localize(
'TaskSystem.noHotSwap',
'Changing the task execution engine with an active task running requires to reload the Window'
),
actions: [
new ReloadWindowAction(ReloadWindowAction.ID, ReloadWindowAction.LABEL, this._windowServive),
new CloseMessageAction()
]
}
);
return;
if (this.executionEngine !== folderSetup[1]) {
if (this._taskSystem && this._taskSystem.getActiveTasks().length > 0) {
this.messageService.show(
Severity.Info,
{
message: nls.localize(
'TaskSystem.noHotSwap',
'Changing the task execution engine with an active task running requires to reload the Window'
),
actions: [
new ReloadWindowAction(ReloadWindowAction.ID, ReloadWindowAction.LABEL, this._windowServive),
new CloseMessageAction()
]
}
);
return;
} else {
this.disposeTaskSystemListeners();
this._taskSystem = undefined;
}
}
this.updateSetup(folderSetup);
this.updateWorkspaceTasks();