Skip to content

Commit

Permalink
Fix #9774 Incorrect TreeView item ordering. (#9775)
Browse files Browse the repository at this point in the history
Signed-off-by: Casey Flynn <[email protected]>
  • Loading branch information
caseyflynn-google authored Jul 26, 2021
1 parent 4431303 commit 59ae8ba
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/plugin-ext/src/plugin/tree/tree-views.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,7 @@ class TreeViewExtImpl<T> implements Disposable {
// ask data provider for children for cached element
const result = await this.treeDataProvider.getChildren(parent);
if (result) {
const treeItems: TreeViewItem[] = [];
const promises = result.map(async (value, index) => {
const treeItemPromises = result.map(async (value, index) => {

// Ask data provider for a tree item for the value
// Data provider must return theia.TreeItem
Expand Down Expand Up @@ -374,11 +373,10 @@ class TreeViewExtImpl<T> implements Disposable {
command: this.commandsConverter.toSafeCommand(treeItem.command, toDisposeElement)
} as TreeViewItem;

treeItems.push(treeViewItem);
return treeViewItem;
});

await Promise.all(promises);
return treeItems;
return Promise.all(treeItemPromises);
} else {
return undefined;
}
Expand Down

0 comments on commit 59ae8ba

Please sign in to comment.