From 8cb8268d7af291f36ce5c4c449258ff36eeacfe5 Mon Sep 17 00:00:00 2001 From: Mark Sujew Date: Thu, 26 Oct 2023 19:57:58 +0200 Subject: [PATCH] Allow tree data providers to return null items (#13018) --- packages/plugin-ext/src/plugin/tree/tree-views.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/plugin-ext/src/plugin/tree/tree-views.ts b/packages/plugin-ext/src/plugin/tree/tree-views.ts index 1b62c35505bfc..d7a130c2a3273 100644 --- a/packages/plugin-ext/src/plugin/tree/tree-views.ts +++ b/packages/plugin-ext/src/plugin/tree/tree-views.ts @@ -34,6 +34,7 @@ import { PluginIconPath } from '../plugin-icon-path'; import { URI } from '@theia/core/shared/vscode-uri'; import { UriComponents } from '@theia/core/lib/common/uri'; import { isObject } from '@theia/core'; +import { coalesce } from '../../common/arrays'; export class TreeViewsExtImpl implements TreeViewsExt { private proxy: TreeViewsMain; @@ -407,7 +408,7 @@ class TreeViewExtImpl implements Disposable { // ask data provider for children for cached element const result = await this.options.treeDataProvider.getChildren(parent); if (result) { - const treeItemPromises = result.map(async value => { + const treeItemPromises = coalesce(result).map(async value => { // Ask data provider for a tree item for the value // Data provider must return theia.TreeItem