From 51c673f265e1a027d2beea74ee6802759230c07b Mon Sep 17 00:00:00 2001 From: Peter van Gulik Date: Wed, 19 Oct 2022 18:26:04 +0200 Subject: [PATCH] fix: invalid tree item (issue #389) which occurs for some datapacks in the datapack explorer in-combination with the latest release of vscode --- .../src/treeDataProviders/datapackDataProvider.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/vscode-extension/src/treeDataProviders/datapackDataProvider.ts b/packages/vscode-extension/src/treeDataProviders/datapackDataProvider.ts index 5ac16f9d..aef65de0 100644 --- a/packages/vscode-extension/src/treeDataProviders/datapackDataProvider.ts +++ b/packages/vscode-extension/src/treeDataProviders/datapackDataProvider.ts @@ -76,12 +76,16 @@ export default class DatapackDataProvider extends BaseDataProvider } public toTreeItem(node: DatapackNode & TreeNode): vscode.TreeItem { + const description = node.getItemDescription?.(); + const tooltip = node.getItemTooltip?.(); + const label = node.getItemLabel?.(); + return { id: node.getId(), - label: node.getItemLabel(), - tooltip: node.getItemTooltip?.(), + label: typeof label === 'string' ? label : '