mirror of
https://github.com/Microsoft/vscode
synced 2024-10-06 03:17:00 +00:00
Fix tree item order when reveal is the cause of getChildren (#200022)
Fixes #191511
This commit is contained in:
parent
1466cbfcdf
commit
95147456e4
|
@ -658,14 +658,17 @@ class ExtHostTreeView<T> extends Disposable {
|
|||
return undefined;
|
||||
}
|
||||
|
||||
const items = await Promise.all(coalesce(elements || []).map(async element => {
|
||||
const item = await this.dataProvider.getTreeItem(element);
|
||||
return item && !cts.token.isCancellationRequested ? this.createAndRegisterTreeNode(element, item, parentNode) : null;
|
||||
const coalescedElements = coalesce(elements || []);
|
||||
const treeItems = await Promise.all(coalesce(coalescedElements).map(element => {
|
||||
return this.dataProvider.getTreeItem(element);
|
||||
}));
|
||||
if (cts.token.isCancellationRequested) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// createAndRegisterTreeNodes adds the nodes to a cache. This must be done sync so that they get added in the correct order.
|
||||
const items = treeItems.map((item, index) => item ? this.createAndRegisterTreeNode(coalescedElements[index], item, parentNode) : null);
|
||||
|
||||
return coalesce(items);
|
||||
} finally {
|
||||
cts.dispose();
|
||||
|
|
Loading…
Reference in a new issue