@@ -74,7 +74,7 @@ import { IPathService } from 'vs/workbench/services/path/common/pathService';
7474import { format } from 'vs/base/common/jsonFormatter' ;
7575import { ITextModelService } from 'vs/editor/common/services/resolverService' ;
7676import { applyEdits } from 'vs/base/common/jsonEdit' ;
77- import { ITextEditorPane , SaveReason } from 'vs/workbench/common/editor' ;
77+ import { SaveReason } from 'vs/workbench/common/editor' ;
7878import { ITextEditorSelection , TextEditorSelectionRevealType } from 'vs/platform/editor/common/editor' ;
7979import { IPreferencesService } from 'vs/workbench/services/preferences/common/preferences' ;
8080import { find } from 'vs/base/common/arrays' ;
@@ -1051,14 +1051,14 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
10511051 return false ;
10521052 }
10531053
1054- private openEditorAtTask ( resource : URI | undefined , task : TaskConfig . CustomTask | TaskConfig . ConfiguringTask | string | undefined ) : Promise < ITextEditorPane | null | undefined > {
1054+ private openEditorAtTask ( resource : URI | undefined , task : TaskConfig . CustomTask | TaskConfig . ConfiguringTask | string | undefined ) : Promise < boolean > {
10551055 if ( resource === undefined ) {
1056- return Promise . resolve ( undefined ) ;
1056+ return Promise . resolve ( false ) ;
10571057 }
10581058 let selection : ITextEditorSelection | undefined ;
10591059 return this . fileService . readFile ( resource ) . then ( content => content . value ) . then ( async content => {
10601060 if ( ! content ) {
1061- return undefined ;
1061+ return false ;
10621062 }
10631063 if ( task ) {
10641064 const contentValue = content . toString ( ) ;
@@ -1101,13 +1101,13 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
11011101 selection,
11021102 selectionRevealType : TextEditorSelectionRevealType . CenterIfOutsideViewport
11031103 }
1104- } ) ;
1104+ } ) . then ( ( ) => ! ! selection ) ;
11051105 } ) ;
11061106 }
11071107
1108- private createCustomizableTask ( task : ContributedTask | CustomTask ) : TaskConfig . CustomTask | TaskConfig . ConfiguringTask | undefined {
1108+ private createCustomizableTask ( task : ContributedTask | CustomTask | ConfiguringTask ) : TaskConfig . CustomTask | TaskConfig . ConfiguringTask | undefined {
11091109 let toCustomize : TaskConfig . CustomTask | TaskConfig . ConfiguringTask | undefined ;
1110- let taskConfig = CustomTask . is ( task ) ? task . _source . config : undefined ;
1110+ let taskConfig = CustomTask . is ( task ) || ConfiguringTask . is ( task ) ? task . _source . config : undefined ;
11111111 if ( taskConfig && taskConfig . element ) {
11121112 toCustomize = { ...( taskConfig . element ) } ;
11131113 } else if ( ContributedTask . is ( task ) ) {
@@ -1138,7 +1138,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
11381138 return toCustomize ;
11391139 }
11401140
1141- public customize ( task : ContributedTask | CustomTask , properties ?: CustomizationProperties , openConfig ?: boolean ) : Promise < void > {
1141+ public customize ( task : ContributedTask | CustomTask | ConfiguringTask , properties ?: CustomizationProperties , openConfig ?: boolean ) : Promise < void > {
11421142 const workspaceFolder = task . getWorkspaceFolder ( ) ;
11431143 if ( ! workspaceFolder ) {
11441144 return Promise . resolve ( undefined ) ;
@@ -1272,14 +1272,14 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
12721272 }
12731273 }
12741274
1275- public openConfig ( task : CustomTask | ConfiguringTask | undefined ) : Promise < void > {
1275+ public openConfig ( task : CustomTask | ConfiguringTask | undefined ) : Promise < boolean > {
12761276 let resource : URI | undefined ;
12771277 if ( task ) {
12781278 resource = this . getResourceForTask ( task ) ;
12791279 } else {
12801280 resource = ( this . _workspaceFolders && ( this . _workspaceFolders . length > 0 ) ) ? this . _workspaceFolders [ 0 ] . toResource ( '.vscode/tasks.json' ) : undefined ;
12811281 }
1282- return this . openEditorAtTask ( resource , task ? task . _label : undefined ) . then ( ( ) => undefined ) ;
1282+ return this . openEditorAtTask ( resource , task ? task . _label : undefined ) ;
12831283 }
12841284
12851285 private createRunnableTask ( tasks : TaskMap , group : TaskGroup ) : { task : Task ; resolver : ITaskResolver } | undefined {
0 commit comments