Skip to content

Commit 595d867

Browse files
committed
fix test
1 parent 6bf1722 commit 595d867

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

src/notebooks/deepnote/deepnoteTreeDataProvider.ts

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff 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 {

0 commit comments

Comments
 (0)