File tree Expand file tree Collapse file tree 1 file changed +15
-14
lines changed Expand file tree Collapse file tree 1 file changed +15
-14
lines changed Original file line number Diff line number Diff line change @@ -131,28 +131,29 @@ export class DeepnoteTreeDataProvider implements TreeDataProvider<DeepnoteTreeIt
131131 }
132132
133133 public async getChildren ( element ?: DeepnoteTreeItem ) : Promise < DeepnoteTreeItem [ ] > {
134- if ( ! workspace . workspaceFolders || workspace . workspaceFolders . length === 0 ) {
134+ // If element is provided, we can return children regardless of workspace
135+ if ( element ) {
136+ if ( element . type === DeepnoteTreeItemType . ProjectFile ) {
137+ return this . getNotebooksForProject ( element ) ;
138+ }
139+
135140 return [ ] ;
136141 }
137142
138- if ( ! element ) {
139- if ( ! this . isInitialScanComplete ) {
140- if ( ! this . initialScanPromise ) {
141- this . initialScanPromise = this . performInitialScan ( ) ;
142- }
143+ // For root level, we need workspace folders
144+ if ( ! workspace . workspaceFolders || workspace . workspaceFolders . length === 0 ) {
145+ return [ ] ;
146+ }
143147
144- // Show loading item
145- return [ this . createLoadingTreeItem ( ) ] ;
148+ if ( ! this . isInitialScanComplete ) {
149+ if ( ! this . initialScanPromise ) {
150+ this . initialScanPromise = this . performInitialScan ( ) ;
146151 }
147152
148- return this . getDeepnoteProjectFiles ( ) ;
149- }
150-
151- if ( element . type === DeepnoteTreeItemType . ProjectFile ) {
152- return this . getNotebooksForProject ( element ) ;
153+ return [ this . createLoadingTreeItem ( ) ] ;
153154 }
154155
155- return [ ] ;
156+ return this . getDeepnoteProjectFiles ( ) ;
156157 }
157158
158159 private createLoadingTreeItem ( ) : DeepnoteTreeItem {
You can’t perform that action at this time.
0 commit comments