提交 ad662592 编写于 作者: I isidor

explorer: take the root that is the closest to the stat

fixes #72299
上级 8ef8aa6b
......@@ -511,8 +511,10 @@ export class ExplorerView extends ViewletPanel {
return;
}
// Expand all stats in the parent chain
let item: ExplorerItem | undefined = this.explorerService.roots.filter(i => isEqualOrParent(resource, i.resource))[0];
// Expand all stats in the parent chain.
let item: ExplorerItem | undefined = this.explorerService.roots.filter(i => isEqualOrParent(resource, i.resource))
// Take the root that is the closest to the stat #72299
.sort((first, second) => second.resource.path.length - first.resource.path.length)[0];
while (item && item.resource.toString() !== resource.toString()) {
await this.tree.expand(item);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册