Browse Source

Fixes duplicated context on view debug tooltips

main
Eric Amodio 2 years ago
parent
commit
0bfce9a5f6
1 changed files with 14 additions and 16 deletions
  1. +14
    -16
      src/views/viewBase.ts

+ 14
- 16
src/views/viewBase.ts View File

@ -134,24 +134,22 @@ export abstract class ViewBase<
this.getTreeItem = async function (this: ViewBase<RootNode, ViewConfig>, node: ViewNode) { this.getTreeItem = async function (this: ViewBase<RootNode, ViewConfig>, node: ViewNode) {
const item = await getTreeItemFn.apply(this, [node]); const item = await getTreeItemFn.apply(this, [node]);
const parent = node.getParent();
if (node.resolveTreeItem != null) {
if (item.tooltip != null) {
addDebuggingInfo(item, node, parent);
}
if (node.resolveTreeItem == null) {
addDebuggingInfo(item, node, node.getParent());
}
const resolveTreeItemFn = node.resolveTreeItem;
node.resolveTreeItem = async function (this: ViewBase<RootNode, ViewConfig>, item: TreeItem) {
const resolvedItem = await resolveTreeItemFn.apply(this, [item]);
return item;
};
addDebuggingInfo(resolvedItem, node, parent);
const resolveTreeItemFn = this.resolveTreeItem;
this.resolveTreeItem = async function (
this: ViewBase<RootNode, ViewConfig>,
item: TreeItem,
node: ViewNode,
) {
item = await resolveTreeItemFn.apply(this, [item, node]);
return resolvedItem;
};
} else {
addDebuggingInfo(item, node, parent);
}
addDebuggingInfo(item, node, node.getParent());
return item; return item;
}; };
@ -556,7 +554,7 @@ export abstract class ViewBase<
context?: Record<string, unknown>, context?: Record<string, unknown>,
) { ) {
if (previousNode != null) { if (previousNode != null) {
(await this.reveal(previousNode, { select: true }));
await this.reveal(previousNode, { select: true });
} }
await node.loadMore(limit, context); await node.loadMore(limit, context);

Loading…
Cancel
Save