mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 02:28:34 +01:00
@@ -293,7 +293,7 @@ class ExtHostTreeView<T> extends Disposable {
|
||||
return this.elements.get(treeItemHandle);
|
||||
}
|
||||
|
||||
reveal(element: T, options?: IRevealOptions): Promise<void> {
|
||||
reveal(element: T | undefined, options?: IRevealOptions): Promise<void> {
|
||||
options = options ? options : { select: true, focus: false };
|
||||
const select = isUndefinedOrNull(options.select) ? true : options.select;
|
||||
const focus = isUndefinedOrNull(options.focus) ? false : options.focus;
|
||||
@@ -302,10 +302,15 @@ class ExtHostTreeView<T> extends Disposable {
|
||||
if (typeof this.dataProvider.getParent !== 'function') {
|
||||
return Promise.reject(new Error(`Required registered TreeDataProvider to implement 'getParent' method to access 'reveal' method`));
|
||||
}
|
||||
return this.refreshPromise
|
||||
.then(() => this.resolveUnknownParentChain(element))
|
||||
.then(parentChain => this.resolveTreeNode(element, parentChain[parentChain.length - 1])
|
||||
.then(treeNode => this.proxy.$reveal(this.viewId, treeNode.item, parentChain.map(p => p.item), { select, focus, expand })), error => this.logService.error(error));
|
||||
|
||||
if (element) {
|
||||
return this.refreshPromise
|
||||
.then(() => this.resolveUnknownParentChain(element))
|
||||
.then(parentChain => this.resolveTreeNode(element, parentChain[parentChain.length - 1])
|
||||
.then(treeNode => this.proxy.$reveal(this.viewId, { item: treeNode.item, parentChain: parentChain.map(p => p.item) }, { select, focus, expand })), error => this.logService.error(error));
|
||||
} else {
|
||||
return this.proxy.$reveal(this.viewId, undefined, { select, focus, expand });
|
||||
}
|
||||
}
|
||||
|
||||
private _message: string = '';
|
||||
|
||||
Reference in New Issue
Block a user