First pass at resolving task definition and passing back to custom execution (#83764)

First pass at resolving task definition and passing back to custom execution. It only currently resolves simple predefined variables, no input, command, or defaultBuildTask.

Part of #81007
This commit is contained in:
Alex Ross
2019-11-05 16:35:21 +01:00
committed by GitHub
parent ebe8e1e135
commit ab89935fd3
5 changed files with 60 additions and 8 deletions

View File

@@ -457,6 +457,10 @@ export abstract class ExtHostTaskBase implements ExtHostTaskShape {
return this._onDidExecuteTask.event;
}
protected async resolveDefinition(uri: number | UriComponents | undefined, definition: vscode.TaskDefinition | undefined): Promise<vscode.TaskDefinition | undefined> {
return definition;
}
public async $onDidStartTask(execution: tasks.TaskExecutionDTO, terminalId: number): Promise<void> {
const customExecution: types.CustomExecution | undefined = this._providedCustomExecutions2.get(execution.id);
if (customExecution) {
@@ -466,7 +470,7 @@ export abstract class ExtHostTaskBase implements ExtHostTaskShape {
// Clone the custom execution to keep the original untouched. This is important for multiple runs of the same task.
this._activeCustomExecutions2.set(execution.id, customExecution);
this._terminalService.attachPtyToTerminal(terminalId, await customExecution.callback());
this._terminalService.attachPtyToTerminal(terminalId, await customExecution.callback(await this.resolveDefinition(execution.task?.source.scope, execution.task?.definition)));
}
this._lastStartedTask = execution.id;