提交 19a5bd61 编写于 作者: I isidor

explorer: Tree returns too early from the expand, need to wait for next tick

fixes #77106
上级 df95a55a
......@@ -50,6 +50,7 @@ import { first } from 'vs/base/common/arrays';
import { withNullAsUndefined } from 'vs/base/common/types';
import { IFileService, FileSystemProviderCapabilities } from 'vs/platform/files/common/files';
import { dispose } from 'vs/base/common/lifecycle';
import { timeout } from 'vs/base/common/async';
export class ExplorerView extends ViewletPanel {
static readonly ID: string = 'workbench.explorer.fileView';
......@@ -522,6 +523,8 @@ export class ExplorerView extends ViewletPanel {
while (item && item.resource.toString() !== resource.toString()) {
await this.tree.expand(item);
// Tree returns too early from the expand, need to wait for next tick #77106
await timeout(0);
item = first(values(item.children), i => isEqualOrParent(resource, i.resource));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册