Skip to content

Commit

Permalink
可以将部分节点字段置空
Browse files Browse the repository at this point in the history
  • Loading branch information
sumneko committed Aug 12, 2024
1 parent 0df5e53 commit c382944
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/console/treeView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,13 @@ class TreeDataProvider implements vscode.TreeDataProvider<number> {
}

updateItem(item: TreeItem, data: TreeNodeInfo) {
if (typeof data.name === 'string') {
item.label = data.name;
}
if (typeof data.desc === 'string') {
item.description = data.desc;
}
if (typeof data.tip === 'string') {
item.tooltip = data.tip;
}
item.label = data.name;
item.description = data.desc;
item.tooltip = data.tip;
if (typeof data.icon === 'string') {
item.iconPath = new vscode.ThemeIcon(data.icon);
} else {
item.iconPath = undefined;
}
if (data.hasChilds) {
if (this.manager.treeViews.find(view => view.root === item.uid)) {
Expand Down

0 comments on commit c382944

Please sign in to comment.