From 19a5bd6123b0e032228a55fa8744f32a5c3b2521 Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 21 Aug 2019 15:34:32 +0200 Subject: [PATCH] explorer: Tree returns too early from the expand, need to wait for next tick fixes #77106 --- src/vs/workbench/contrib/files/browser/views/explorerView.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/vs/workbench/contrib/files/browser/views/explorerView.ts b/src/vs/workbench/contrib/files/browser/views/explorerView.ts index c5bd34e7ac6..5a2c00e5786 100644 --- a/src/vs/workbench/contrib/files/browser/views/explorerView.ts +++ b/src/vs/workbench/contrib/files/browser/views/explorerView.ts @@ -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)); } -- GitLab