@@ -2936,22 +2936,33 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
2936
2936
} ) ;
2937
2937
} ) ;
2938
2938
} ;
2939
-
2939
+ let globTasksDetected = false ;
2940
2940
// First check for globs before checking for the default tasks of the task group
2941
2941
const absoluteURI = EditorResourceAccessor . getOriginalUri ( this . _editorService . activeEditor ) ;
2942
2942
if ( absoluteURI ) {
2943
2943
const workspaceFolder = this . _contextService . getWorkspaceFolder ( absoluteURI ) ;
2944
- // fallback to absolute path of the file if it is not in a workspace or relative path cannot be found
2945
- const relativePath = workspaceFolder ?. uri ? ( resources . relativePath ( workspaceFolder . uri , absoluteURI ) ?? absoluteURI . path ) : absoluteURI . path ;
2944
+ if ( workspaceFolder ) {
2945
+ const config = this . _getConfiguration ( workspaceFolder ) ;
2946
+ globTasksDetected = ( ( config ?. config ?. tasks ) || [ ] ) . filter ( task => task . group && typeof task . group !== 'string' && typeof task . group . isDefault === 'string' ) . length > 0 ;
2947
+
2948
+ if ( globTasksDetected ) {
2949
+ // fallback to absolute path of the file if it is not in a workspace or relative path cannot be found
2950
+ const relativePath = workspaceFolder ?. uri ? ( resources . relativePath ( workspaceFolder . uri , absoluteURI ) ?? absoluteURI . path ) : absoluteURI . path ;
2951
+
2952
+ taskGroupTasks = await this . _findWorkspaceTasks ( ( task ) => {
2953
+ const currentTaskGroup = task . configurationProperties . group ;
2954
+ if ( currentTaskGroup && typeof currentTaskGroup !== 'string' && typeof currentTaskGroup . isDefault === 'string' ) {
2955
+ return ( currentTaskGroup . _id === taskGroup . _id && glob . match ( currentTaskGroup . isDefault , relativePath ) ) ;
2956
+ }
2946
2957
2947
- taskGroupTasks = await this . _findWorkspaceTasks ( ( task ) => {
2948
- const currentTaskGroup = task . configurationProperties . group ;
2949
- if ( currentTaskGroup && typeof currentTaskGroup !== 'string' && typeof currentTaskGroup . isDefault === 'string' ) {
2950
- return ( currentTaskGroup . _id === taskGroup . _id && glob . match ( currentTaskGroup . isDefault , relativePath ) ) ;
2958
+ return false ;
2959
+ } ) ;
2951
2960
}
2961
+ }
2962
+ }
2952
2963
2953
- return false ;
2954
- } ) ;
2964
+ if ( ! globTasksDetected && taskGroupTasks . length === 0 ) {
2965
+ taskGroupTasks = await this . _findWorkspaceTasksInGroup ( TaskGroup . Build , true ) ;
2955
2966
}
2956
2967
2957
2968
const handleMultipleTasks = ( areGlobTasks : boolean ) => {
@@ -2991,7 +3002,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
2991
3002
// If there's multiple globs that match we want to show the quick picker for those tasks
2992
3003
// We will need to call splitPerGroupType putting globs in defaults and the remaining tasks in none.
2993
3004
// We don't need to carry on after here
2994
- if ( taskGroupTasks . length > 1 ) {
3005
+ if ( globTasksDetected && taskGroupTasks . length > 1 ) {
2995
3006
return handleMultipleTasks ( true ) ;
2996
3007
}
2997
3008
0 commit comments