@@ -303,11 +303,11 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
303
303
this . _configurationResolverService . contributeVariable ( 'defaultBuildTask' , async ( ) : Promise < string | undefined > => {
304
304
let tasks = await this . _getTasksForGroup ( TaskGroup . Build ) ;
305
305
if ( tasks . length > 0 ) {
306
- const { none , defaults } = this . _splitPerGroupType ( tasks ) ;
306
+ const defaults = this . _getDefaultTasks ( tasks ) ;
307
307
if ( defaults . length === 1 ) {
308
308
return defaults [ 0 ] . _label ;
309
- } else if ( defaults . length + none . length > 0 ) {
310
- tasks = defaults . concat ( none ) ;
309
+ } else if ( defaults . length ) {
310
+ tasks = defaults ;
311
311
}
312
312
}
313
313
@@ -2875,24 +2875,21 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
2875
2875
2876
2876
/**
2877
2877
*
2878
- * @param tasks - The tasks which need filtering from defaults and non-defaults
2879
- * @param taskGlobsInList - This tells splitPerGroupType to filter out globbed tasks (into default), otherwise fall back to boolean
2878
+ * @param tasks - The tasks which need to be filtered
2879
+ * @param taskGlobsInList - This tells splitPerGroupType to filter out globbed tasks (into defaults)
2880
2880
* @returns
2881
2881
*/
2882
- private _splitPerGroupType ( tasks : Task [ ] , taskGlobsInList : boolean = false ) : { none : Task [ ] ; defaults : Task [ ] } {
2883
- const none : Task [ ] = [ ] ;
2882
+ private _getDefaultTasks ( tasks : Task [ ] , taskGlobsInList : boolean = false ) : Task [ ] {
2884
2883
const defaults : Task [ ] = [ ] ;
2885
2884
for ( const task of tasks ) {
2886
2885
// At this point (assuming taskGlobsInList is true) there are tasks with matching globs, so only put those in defaults
2887
2886
if ( taskGlobsInList && typeof ( task . configurationProperties . group as TaskGroup ) . isDefault === 'string' ) {
2888
2887
defaults . push ( task ) ;
2889
2888
} else if ( ! taskGlobsInList && ( task . configurationProperties . group as TaskGroup ) . isDefault === true ) {
2890
2889
defaults . push ( task ) ;
2891
- } else {
2892
- none . push ( task ) ;
2893
2890
}
2894
2891
}
2895
- return { none , defaults } ;
2892
+ return defaults ;
2896
2893
}
2897
2894
2898
2895
private _runTaskGroupCommand ( taskGroup : TaskGroup , strings : {
@@ -2961,12 +2958,12 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
2961
2958
if ( tasks . length > 0 ) {
2962
2959
// If we're dealing with tasks that were chosen because of a glob match,
2963
2960
// then put globs in the defaults and everything else in none
2964
- const { none , defaults } = this . _splitPerGroupType ( tasks , areGlobTasks ) ;
2961
+ const defaults = this . _getDefaultTasks ( tasks , areGlobTasks ) ;
2965
2962
if ( defaults . length === 1 ) {
2966
2963
runSingleTask ( defaults [ 0 ] , undefined , this ) ;
2967
2964
return ;
2968
- } else if ( defaults . length + none . length > 0 ) {
2969
- tasks = defaults . concat ( none ) ;
2965
+ } else if ( defaults . length > 0 ) {
2966
+ tasks = defaults ;
2970
2967
}
2971
2968
}
2972
2969
@@ -2999,7 +2996,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
2999
2996
3000
2997
// If no globs are found or matched fallback to checking for default tasks of the task group
3001
2998
if ( ! taskGroupTasks . length ) {
3002
- taskGroupTasks = await this . _findWorkspaceTasksInGroup ( taskGroup , false ) ;
2999
+ taskGroupTasks = await this . _findWorkspaceTasksInGroup ( taskGroup , true ) ;
3003
3000
}
3004
3001
3005
3002
// A single default task was returned, just run it directly
0 commit comments