update data explorer with vscode's (#6442)

This commit is contained in:
Anthony Dresser
2019-07-22 14:43:45 -07:00
committed by GitHub
parent 0246eec4ed
commit ab4b19f7c3
4 changed files with 344 additions and 277 deletions

View File

@@ -113,7 +113,7 @@ class DataExplorerContainerExtensionHandler implements IWorkbenchContribution {
when: ContextKeyExpr.deserialize(item.when),
canToggleVisibility: true,
collapsed: this.showCollapsed(container),
treeView: this.instantiationService.createInstance(CustomTreeView, item.id, container)
treeView: this.instantiationService.createInstance(CustomTreeView, item.id, item.name, container)
};
viewIds.push(viewDescriptor.id);

View File

@@ -41,7 +41,8 @@ CommandsRegistry.registerCommand({
return oeService.disconnectNode(args.$treeViewId, args.$treeItem).then(() => {
const { treeView } = (<ICustomViewDescriptor>Registry.as<IViewsRegistry>(Extensions.ViewsRegistry).getView(args.$treeViewId));
// we need to collapse it then refresh it so that the tree doesn't try and use it's cache next time the user expands the node
return treeView.collapse(args.$treeItem).then(() => treeView.refresh([args.$treeItem]).then(() => true));
treeView.collapse(args.$treeItem);
treeView.refresh([args.$treeItem]).then(() => true);
});
}
return Promise.resolve(true);