diff --git a/src/views/nodes/viewNode.ts b/src/views/nodes/viewNode.ts index ab885f5..0206a1b 100644 --- a/src/views/nodes/viewNode.ts +++ b/src/views/nodes/viewNode.ts @@ -121,9 +121,7 @@ export abstract class ViewNode { abstract getTreeItem(): TreeItem | Promise; - resolveTreeItem(item: TreeItem): TreeItem | Promise { - return item; - } + resolveTreeItem?(item: TreeItem): TreeItem | Promise; getCommand(): Command | undefined { return undefined; diff --git a/src/views/viewBase.ts b/src/views/viewBase.ts index 5114ec6..c2b74b6 100644 --- a/src/views/viewBase.ts +++ b/src/views/viewBase.ts @@ -277,7 +277,7 @@ export abstract class ViewBase< } resolveTreeItem(item: TreeItem, node: ViewNode): TreeItem | Promise { - return node.resolveTreeItem(item); + return node.resolveTreeItem?.(item) ?? item; } protected onElementCollapsed(e: TreeViewExpansionEvent) {