Skip to content

Commit 25a5942

Browse files
committed
Fix: fall through to getRootNodes() when no progressive items arrive
After the 30s timeout, if no progressive notifications were received (e.g., eclipse.jdt.ls progressive notifications not yet available), fall through to the normal getRootNodes() path instead of returning an empty array. This ensures the worst case matches today's behavior. Addresses review comment from wenytang-ms.
1 parent b864584 commit 25a5942

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/views/dependencyDataProvider.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,13 @@ export class DependencyDataProvider implements TreeDataProvider<ExplorerNode> {
152152
const timeout = new Promise<void>((resolve) => setTimeout(resolve, 30_000));
153153
await Promise.race([this._progressiveItemsReady, timeout]);
154154
}
155-
return this._rootItems || [];
155+
// If progressive items arrived, return them. Otherwise fall
156+
// through to the normal getRootNodes() path so the tree is
157+
// never left blank (e.g., when the JDTLS progressive
158+
// notifications are not available yet).
159+
if (this._rootItems && this._rootItems.length > 0) {
160+
return this._rootItems;
161+
}
156162
}
157163

158164
const children = (!this._rootItems || !element) ?

0 commit comments

Comments
 (0)