fix refresh node and add sample (#16888)

This commit is contained in:
Alan Ren
2021-08-25 14:52:45 -07:00
committed by GitHub
parent fe1f8fb2f3
commit ab1112bfb3
4 changed files with 58 additions and 29 deletions

View File

@@ -44,7 +44,7 @@ export interface IServerTreeView {
deleteObjectExplorerNodeAndRefreshTree(profile: ConnectionProfile): Promise<void>;
getSelection(): Array<ServerTreeElement>;
isFocused(): boolean;
refreshElement(node: TreeNode): Promise<void>;
refreshElement(node: ServerTreeElement): Promise<void>;
readonly treeActionProvider: ServerTreeActionProvider;
isExpanded(node?: ServerTreeElement): boolean;
reveal(node: ServerTreeElement): Promise<void>;
@@ -722,7 +722,7 @@ export class ObjectExplorerService implements IObjectExplorerService {
if (!treeNode) {
return undefined;
}
await this._serverTreeView?.refreshElement(treeNode);
await this._serverTreeView?.refreshElement(this.getTreeItem(treeNode));
if (treeNode?.children?.length ?? -1 > 0) {
await treeNode?.setExpandedState(TreeItemCollapsibleState.Expanded);
}