File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed
Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ export class TaskTreeDataProvider implements vscode.TreeDataProvider<elements.Tr
3838 }
3939
4040 // If there are no taskfiles, return an empty array
41- if ( ! this . _taskfiles ) {
41+ if ( ! this . _taskfiles || this . _taskfiles . length === 0 ) {
4242 return Promise . resolve ( [ ] ) ;
4343 }
4444
Original file line number Diff line number Diff line change @@ -12,18 +12,23 @@ export class TaskExtension {
1212 constructor ( ) {
1313 this . _activityBar = new elements . ActivityBar ( ) ;
1414 this . _watcher = vscode . workspace . createFileSystemWatcher ( "**/*.{yml,yaml}" ) ;
15- services . taskfile . checkInstallation ( ) . then ( status => {
16- vscode . commands . executeCommand ( 'setContext' , 'vscode-task:status' , status ) ;
17- } ) ;
1815 this . setTreeNesting ( settings . treeNesting ) ;
1916 }
2017
2118 public async update ( ) : Promise < void > {
22- let p : Promise < models . Taskfile > [ ] = [ ] ;
23- vscode . workspace . workspaceFolders ?. forEach ( ( folder ) => {
24- p . push ( services . taskfile . read ( folder . uri . fsPath ) ) ;
25- } ) ;
26- await Promise . all ( p ) . then ( ( taskfiles : models . Taskfile [ ] ) => {
19+ // Do version checks
20+ await services . taskfile . checkInstallation ( ) . then ( ( status ) : Promise < models . Taskfile [ ] > => {
21+ vscode . commands . executeCommand ( 'setContext' , 'vscode-task:status' , status ) ;
22+ if ( status === "ready" ) {
23+ // Read taskfiles
24+ let p : Promise < models . Taskfile > [ ] = [ ] ;
25+ vscode . workspace . workspaceFolders ?. forEach ( ( folder ) => {
26+ p . push ( services . taskfile . read ( folder . uri . fsPath ) ) ;
27+ } ) ;
28+ return Promise . all ( p ) ;
29+ }
30+ return Promise . resolve ( [ ] ) ;
31+ } ) . then ( ( taskfiles : models . Taskfile [ ] ) => {
2732 this . _taskfiles = taskfiles ;
2833 } ) ;
2934 }
You can’t perform that action at this time.
0 commit comments