Skip to content

Commit

Permalink
Feedback from resolveTreeItem API proposal review
Browse files Browse the repository at this point in the history
Part of #100741
  • Loading branch information
alexr00 committed Nov 23, 2020
1 parent 21a4224 commit ea989da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/vs/vscode.proposed.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ declare module 'vscode' {
* @param element
* @param item Undefined properties of `item` should be set then `item` should be returned.
*/
resolveTreeItem?(element: T, item: TreeItem2): TreeItem2 | Thenable<TreeItem2>;
resolveTreeItem?(item: TreeItem2, element: T): ProviderResult<TreeItem2>;
}

export class TreeItem2 extends TreeItem {
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/api/common/extHostTreeViews.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ class ExtHostTreeView<T> extends Disposable {
if (element) {
const node = this.nodes.get(element);
if (node) {
const resolve = await this.dataProvider.resolveTreeItem(element, node.extensionItem);
const resolve = await this.dataProvider.resolveTreeItem(node.extensionItem, element) ?? node.extensionItem;
// Resolvable elements. Currently only tooltip.
node.item.tooltip = this.getTooltip(resolve.tooltip);
return node.item;
Expand Down

0 comments on commit ea989da

Please sign in to comment.