@@ -934,7 +934,10 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
934934 try {
935935 const resolvedTask = await matchingProvider . resolveTask ( configuringTask ) ;
936936 if ( resolvedTask && ( resolvedTask . _id === configuringTask . _id ) ) {
937- return TaskConfig . createCustomTask ( resolvedTask , configuringTask ) ;
937+ if ( ContributedTask . is ( resolvedTask ) ) {
938+ return TaskConfig . createCustomTask ( resolvedTask , configuringTask ) ;
939+ }
940+ return resolvedTask ;
938941 }
939942 } catch ( error ) {
940943 // Ignore errors. The task could not be provided by any of the providers.
@@ -944,7 +947,10 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
944947 const tasks = await this . tasks ( { type : configuringTask . type } ) ;
945948 for ( const task of tasks ) {
946949 if ( task . _id === configuringTask . _id ) {
947- return TaskConfig . createCustomTask ( < ContributedTask > task , configuringTask ) ;
950+ if ( ContributedTask . is ( task ) ) {
951+ return TaskConfig . createCustomTask ( task , configuringTask ) ;
952+ }
953+ return task ;
948954 }
949955 }
950956
@@ -2353,7 +2359,11 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
23532359 try {
23542360 const resolvedTask = await provider . resolveTask ( configuringTask ) ;
23552361 if ( resolvedTask && ( resolvedTask . _id === configuringTask . _id ) ) {
2356- result . add ( key , TaskConfig . createCustomTask ( resolvedTask , configuringTask ) ) ;
2362+ if ( ContributedTask . is ( resolvedTask ) ) {
2363+ result . add ( key , TaskConfig . createCustomTask ( resolvedTask , configuringTask ) ) ;
2364+ } else {
2365+ result . add ( key , resolvedTask ) ;
2366+ }
23572367 return ;
23582368 }
23592369 } catch ( error ) {
0 commit comments