@@ -88,7 +88,7 @@ export namespace ProcessExecutionOptionsDTO {
8888}
8989
9090export namespace ProcessExecutionDTO {
91- export function is ( value : tasks . ShellExecutionDTO | tasks . ProcessExecutionDTO | tasks . CustomExecution2DTO | undefined ) : value is tasks . ProcessExecutionDTO {
91+ export function is ( value : tasks . ShellExecutionDTO | tasks . ProcessExecutionDTO | tasks . CustomExecutionDTO | undefined ) : value is tasks . ProcessExecutionDTO {
9292 if ( value ) {
9393 const candidate = value as tasks . ProcessExecutionDTO ;
9494 return candidate && ! ! candidate . process ;
@@ -133,7 +133,7 @@ export namespace ShellExecutionOptionsDTO {
133133}
134134
135135export namespace ShellExecutionDTO {
136- export function is ( value : tasks . ShellExecutionDTO | tasks . ProcessExecutionDTO | tasks . CustomExecution2DTO | undefined ) : value is tasks . ShellExecutionDTO {
136+ export function is ( value : tasks . ShellExecutionDTO | tasks . ProcessExecutionDTO | tasks . CustomExecutionDTO | undefined ) : value is tasks . ShellExecutionDTO {
137137 if ( value ) {
138138 const candidate = value as tasks . ShellExecutionDTO ;
139139 return candidate && ( ! ! candidate . commandLine || ! ! candidate . command ) ;
@@ -170,19 +170,19 @@ export namespace ShellExecutionDTO {
170170 }
171171}
172172
173- export namespace CustomExecution2DTO {
174- export function is ( value : tasks . ShellExecutionDTO | tasks . ProcessExecutionDTO | tasks . CustomExecution2DTO | undefined ) : value is tasks . CustomExecution2DTO {
173+ export namespace CustomExecutionDTO {
174+ export function is ( value : tasks . ShellExecutionDTO | tasks . ProcessExecutionDTO | tasks . CustomExecutionDTO | undefined ) : value is tasks . CustomExecutionDTO {
175175 if ( value ) {
176- let candidate = value as tasks . CustomExecution2DTO ;
177- return candidate && candidate . customExecution === 'customExecution2 ' ;
176+ let candidate = value as tasks . CustomExecutionDTO ;
177+ return candidate && candidate . customExecution === 'customExecution ' ;
178178 } else {
179179 return false ;
180180 }
181181 }
182182
183- export function from ( value : vscode . CustomExecution2 ) : tasks . CustomExecution2DTO {
183+ export function from ( value : vscode . CustomExecution ) : tasks . CustomExecutionDTO {
184184 return {
185- customExecution : 'customExecution2 '
185+ customExecution : 'customExecution '
186186 } ;
187187 }
188188}
@@ -220,13 +220,13 @@ export namespace TaskDTO {
220220 if ( value === undefined || value === null ) {
221221 return undefined ;
222222 }
223- let execution : tasks . ShellExecutionDTO | tasks . ProcessExecutionDTO | tasks . CustomExecution2DTO | undefined ;
223+ let execution : tasks . ShellExecutionDTO | tasks . ProcessExecutionDTO | tasks . CustomExecutionDTO | undefined ;
224224 if ( value . execution instanceof types . ProcessExecution ) {
225225 execution = ProcessExecutionDTO . from ( value . execution ) ;
226226 } else if ( value . execution instanceof types . ShellExecution ) {
227227 execution = ShellExecutionDTO . from ( value . execution ) ;
228- } else if ( ( < vscode . Task2 > value ) . execution2 && ( < vscode . Task2 > value ) . execution2 instanceof types . CustomExecution2 ) {
229- execution = CustomExecution2DTO . from ( < types . CustomExecution2 > ( < vscode . Task2 > value ) . execution2 ) ;
228+ } else if ( ( < vscode . Task2 > value ) . execution2 && ( < vscode . Task2 > value ) . execution2 instanceof types . CustomExecution ) {
229+ execution = CustomExecutionDTO . from ( < types . CustomExecution > ( < vscode . Task2 > value ) . execution2 ) ;
230230 }
231231
232232 const definition : tasks . TaskDefinitionDTO | undefined = TaskDefinitionDTO . from ( value . definition ) ;
@@ -373,9 +373,9 @@ export abstract class ExtHostTaskBase implements ExtHostTaskShape {
373373 protected _handleCounter : number ;
374374 protected _handlers : Map < number , HandlerData > ;
375375 protected _taskExecutions : Map < string , TaskExecutionImpl > ;
376- protected _providedCustomExecutions2 : Map < string , types . CustomExecution2 > ;
376+ protected _providedCustomExecutions2 : Map < string , types . CustomExecution > ;
377377 private _notProvidedCustomExecutions : Set < string > ; // Used for custom executions tasks that are created and run through executeTask.
378- protected _activeCustomExecutions2 : Map < string , types . CustomExecution2 > ;
378+ protected _activeCustomExecutions2 : Map < string , types . CustomExecution > ;
379379 private _lastStartedTask : string | undefined ;
380380 protected readonly _onDidExecuteTask : Emitter < vscode . TaskStartEvent > = new Emitter < vscode . TaskStartEvent > ( ) ;
381381 protected readonly _onDidTerminateTask : Emitter < vscode . TaskEndEvent > = new Emitter < vscode . TaskEndEvent > ( ) ;
@@ -399,9 +399,9 @@ export abstract class ExtHostTaskBase implements ExtHostTaskShape {
399399 this . _handleCounter = 0 ;
400400 this . _handlers = new Map < number , HandlerData > ( ) ;
401401 this . _taskExecutions = new Map < string , TaskExecutionImpl > ( ) ;
402- this . _providedCustomExecutions2 = new Map < string , types . CustomExecution2 > ( ) ;
402+ this . _providedCustomExecutions2 = new Map < string , types . CustomExecution > ( ) ;
403403 this . _notProvidedCustomExecutions = new Set < string > ( ) ;
404- this . _activeCustomExecutions2 = new Map < string , types . CustomExecution2 > ( ) ;
404+ this . _activeCustomExecutions2 = new Map < string , types . CustomExecution > ( ) ;
405405 }
406406
407407 public registerTaskProvider ( extension : IExtensionDescription , type : string , provider : vscode . TaskProvider ) : vscode . Disposable {
@@ -454,15 +454,15 @@ export abstract class ExtHostTaskBase implements ExtHostTaskShape {
454454 }
455455
456456 public async $onDidStartTask ( execution : tasks . TaskExecutionDTO , terminalId : number ) : Promise < void > {
457- const execution2 : types . CustomExecution2 | undefined = this . _providedCustomExecutions2 . get ( execution . id ) ;
458- if ( execution2 ) {
457+ const customExecution : types . CustomExecution | undefined = this . _providedCustomExecutions2 . get ( execution . id ) ;
458+ if ( customExecution ) {
459459 if ( this . _activeCustomExecutions2 . get ( execution . id ) !== undefined ) {
460460 throw new Error ( 'We should not be trying to start the same custom task executions twice.' ) ;
461461 }
462462
463463 // Clone the custom execution to keep the original untouched. This is important for multiple runs of the same task.
464- this . _activeCustomExecutions2 . set ( execution . id , execution2 ) ;
465- this . _terminalService . attachPtyToTerminal ( terminalId , await execution2 . callback ( ) ) ;
464+ this . _activeCustomExecutions2 . set ( execution . id , customExecution ) ;
465+ this . _terminalService . attachPtyToTerminal ( terminalId , await customExecution . callback ( ) ) ;
466466 }
467467 this . _lastStartedTask = execution . id ;
468468
@@ -573,8 +573,8 @@ export abstract class ExtHostTaskBase implements ExtHostTaskShape {
573573 throw new Error ( 'Unexpected: The resolved task definition must be the same object as the original task definition. The task definition cannot be changed.' ) ;
574574 }
575575
576- if ( CustomExecution2DTO . is ( resolvedTaskDTO . execution ) ) {
577- await this . addCustomExecution2 ( resolvedTaskDTO , < vscode . Task2 > resolvedTask , true ) ;
576+ if ( CustomExecutionDTO . is ( resolvedTaskDTO . execution ) ) {
577+ await this . addCustomExecution ( resolvedTaskDTO , < vscode . Task2 > resolvedTask , true ) ;
578578 }
579579
580580 return await this . resolveTaskInternal ( resolvedTaskDTO ) ;
@@ -588,12 +588,12 @@ export abstract class ExtHostTaskBase implements ExtHostTaskShape {
588588 return this . _handleCounter ++ ;
589589 }
590590
591- protected async addCustomExecution2 ( taskDTO : tasks . TaskDTO , task : vscode . Task2 , isProvided : boolean ) : Promise < void > {
591+ protected async addCustomExecution ( taskDTO : tasks . TaskDTO , task : vscode . Task2 , isProvided : boolean ) : Promise < void > {
592592 const taskId = await this . _proxy . $createTaskId ( taskDTO ) ;
593593 if ( ! isProvided && ! this . _providedCustomExecutions2 . has ( taskId ) ) {
594594 this . _notProvidedCustomExecutions . add ( taskId ) ;
595595 }
596- this . _providedCustomExecutions2 . set ( taskId , < types . CustomExecution2 > ( < vscode . Task2 > task ) . execution2 ) ;
596+ this . _providedCustomExecutions2 . set ( taskId , < types . CustomExecution > ( < vscode . Task2 > task ) . execution2 ) ;
597597 }
598598
599599 protected async getTaskExecution ( execution : tasks . TaskExecutionDTO | string , task ?: vscode . Task ) : Promise < TaskExecutionImpl > {
@@ -619,7 +619,7 @@ export abstract class ExtHostTaskBase implements ExtHostTaskShape {
619619 }
620620
621621 private customExecutionComplete ( execution : tasks . TaskExecutionDTO ) : void {
622- const extensionCallback2 : vscode . CustomExecution2 | undefined = this . _activeCustomExecutions2 . get ( execution . id ) ;
622+ const extensionCallback2 : vscode . CustomExecution | undefined = this . _activeCustomExecutions2 . get ( execution . id ) ;
623623 if ( extensionCallback2 ) {
624624 this . _activeCustomExecutions2 . delete ( execution . id ) ;
625625 }
@@ -674,8 +674,8 @@ export class WorkerExtHostTask extends ExtHostTaskBase {
674674 // If this task is a custom execution, then we need to save it away
675675 // in the provided custom execution map that is cleaned up after the
676676 // task is executed.
677- if ( CustomExecution2DTO . is ( dto . execution ) ) {
678- await this . addCustomExecution2 ( dto , < vscode . Task2 > task , false ) ;
677+ if ( CustomExecutionDTO . is ( dto . execution ) ) {
678+ await this . addCustomExecution ( dto , < vscode . Task2 > task , false ) ;
679679 } else {
680680 throw new Error ( 'Not implemented' ) ;
681681 }
@@ -692,12 +692,12 @@ export class WorkerExtHostTask extends ExtHostTaskBase {
692692 }
693693
694694 const taskDTO : tasks . TaskDTO | undefined = TaskDTO . from ( task , handler . extension ) ;
695- if ( taskDTO && CustomExecution2DTO . is ( taskDTO . execution ) ) {
695+ if ( taskDTO && CustomExecutionDTO . is ( taskDTO . execution ) ) {
696696 taskDTOs . push ( taskDTO ) ;
697697 // The ID is calculated on the main thread task side, so, let's call into it here.
698698 // We need the task id's pre-computed for custom task executions because when OnDidStartTask
699699 // is invoked, we have to be able to map it back to our data.
700- taskIdPromises . push ( this . addCustomExecution2 ( taskDTO , < vscode . Task2 > task , true ) ) ;
700+ taskIdPromises . push ( this . addCustomExecution ( taskDTO , < vscode . Task2 > task , true ) ) ;
701701 } else {
702702 console . warn ( 'Only custom execution tasks supported.' ) ;
703703 }
@@ -710,7 +710,7 @@ export class WorkerExtHostTask extends ExtHostTaskBase {
710710 }
711711
712712 protected async resolveTaskInternal ( resolvedTaskDTO : tasks . TaskDTO ) : Promise < tasks . TaskDTO | undefined > {
713- if ( CustomExecution2DTO . is ( resolvedTaskDTO . execution ) ) {
713+ if ( CustomExecutionDTO . is ( resolvedTaskDTO . execution ) ) {
714714 return resolvedTaskDTO ;
715715 } else {
716716 console . warn ( 'Only custom execution tasks supported.' ) ;
0 commit comments