mirror of
https://github.com/Microsoft/vscode
synced 2024-10-13 23:09:01 +00:00
parent
de976e87dd
commit
46d8d3aa69
|
@ -33,7 +33,7 @@ import { IOutputService } from 'vs/workbench/contrib/output/common/output';
|
|||
import { StartStopProblemCollector, WatchingProblemCollector, ProblemCollectorEventKind, ProblemHandlingStrategy } from 'vs/workbench/contrib/tasks/common/problemCollectors';
|
||||
import {
|
||||
Task, CustomTask, ContributedTask, RevealKind, CommandOptions, ShellConfiguration, RuntimeType, PanelKind,
|
||||
TaskEvent, TaskEventKind, ShellQuotingOptions, ShellQuoting, CommandString, CommandConfiguration, ExtensionTaskSource, TaskScope, RevealProblemKind, DependsOrder, TaskSourceKind
|
||||
TaskEvent, TaskEventKind, ShellQuotingOptions, ShellQuoting, CommandString, CommandConfiguration, ExtensionTaskSource, TaskScope, RevealProblemKind, DependsOrder, TaskSourceKind, InMemoryTask
|
||||
} from 'vs/workbench/contrib/tasks/common/tasks';
|
||||
import {
|
||||
ITaskSystem, ITaskSummary, ITaskExecuteResult, TaskExecuteKind, TaskError, TaskErrors, ITaskResolver,
|
||||
|
@ -250,10 +250,12 @@ export class TerminalTaskSystem implements ITaskSystem {
|
|||
executeResult.promise.then(summary => {
|
||||
this.lastTask = this.currentTask;
|
||||
});
|
||||
if (!this.instances[commonKey]) {
|
||||
this.instances[commonKey] = new InstanceManager();
|
||||
if (InMemoryTask.is(task) || !this.isTaskEmpty(task)) {
|
||||
if (!this.instances[commonKey]) {
|
||||
this.instances[commonKey] = new InstanceManager();
|
||||
}
|
||||
this.instances[commonKey].addInstance();
|
||||
}
|
||||
this.instances[commonKey].addInstance();
|
||||
return executeResult;
|
||||
} catch (error) {
|
||||
if (error instanceof TaskError) {
|
||||
|
@ -606,8 +608,7 @@ export class TerminalTaskSystem implements ITaskSystem {
|
|||
const resolvedVariables = this.resolveVariablesFromSet(systemInfo, workspaceFolder, task, variables, alreadyResolved);
|
||||
|
||||
return resolvedVariables.then((resolvedVariables) => {
|
||||
const isCustomExecution = (task.command.runtime === RuntimeType.CustomExecution);
|
||||
if (resolvedVariables && (task.command !== undefined) && task.command.runtime && (isCustomExecution || (task.command.name !== undefined))) {
|
||||
if (resolvedVariables && !this.isTaskEmpty(task)) {
|
||||
this.currentTask.resolvedVariables = resolvedVariables;
|
||||
return this.executeInTerminal(task, trigger, new VariableResolver(workspaceFolder, systemInfo, resolvedVariables.variables, this.configurationResolverService), workspaceFolder);
|
||||
} else {
|
||||
|
@ -620,6 +621,11 @@ export class TerminalTaskSystem implements ITaskSystem {
|
|||
});
|
||||
}
|
||||
|
||||
private isTaskEmpty(task: CustomTask | ContributedTask): boolean {
|
||||
const isCustomExecution = (task.command.runtime === RuntimeType.CustomExecution);
|
||||
return !((task.command !== undefined) && task.command.runtime && (isCustomExecution || (task.command.name !== undefined)));
|
||||
}
|
||||
|
||||
private reexecuteCommand(task: CustomTask | ContributedTask, trigger: string, alreadyResolved: Map<string, string>): Promise<ITaskSummary> {
|
||||
const lastTask = this.lastTask;
|
||||
if (!lastTask) {
|
||||
|
|
Loading…
Reference in a new issue