mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 13:29:44 +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;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
const items = await Promise.all(coalesce(elements || []).map(async element => {
|
const coalescedElements = coalesce(elements || []);
|
||||||
const item = await this.dataProvider.getTreeItem(element);
|
const treeItems = await Promise.all(coalesce(coalescedElements).map(element => {
|
||||||
return item && !cts.token.isCancellationRequested ? this.createAndRegisterTreeNode(element, item, parentNode) : null;
|
return this.dataProvider.getTreeItem(element);
|
||||||
}));
|
}));
|
||||||
if (cts.token.isCancellationRequested) {
|
if (cts.token.isCancellationRequested) {
|
||||||
return undefined;
|
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);
|
return coalesce(items);
|
||||||
} finally {
|
} finally {
|
||||||
cts.dispose();
|
cts.dispose();
|
||||||
|
|
Loading…
Reference in a new issue