From e720530819d6a69cb37beac12cff7aacfcdcecf0 Mon Sep 17 00:00:00 2001 From: isidor Date: Tue, 3 Nov 2020 10:41:17 +0100 Subject: [PATCH] Open to side: do not first use fileService for resolving, since item is already part of explorer model fixes #109780 --- .../contrib/files/browser/fileCommands.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/contrib/files/browser/fileCommands.ts b/src/vs/workbench/contrib/files/browser/fileCommands.ts index 0d0b8e2375e..bdd9975fc72 100644 --- a/src/vs/workbench/contrib/files/browser/fileCommands.ts +++ b/src/vs/workbench/contrib/files/browser/fileCommands.ts @@ -134,9 +134,18 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ const untitledResources = resources.filter(resource => resource.scheme === Schemas.untitled); const fileResources = resources.filter(resource => resource.scheme !== Schemas.untitled); - const resolved = await fileService.resolveAll(fileResources.map(resource => ({ resource }))); - const editors = resolved.filter(r => r.stat && r.success && !r.stat.isDirectory).map(r => ({ - resource: r.stat!.resource, + const items = await Promise.all(fileResources.map(async resource => { + const item = explorerService.findClosest(resource); + if (item) { + // Explorer already resolved the item, no need to go to the file service #109780 + return item; + } + + return await fileService.resolve(resource); + })); + const files = items.filter(i => !i.isDirectory); + const editors = files.map(f => ({ + resource: f.resource, options: { pinned: true } })).concat(...untitledResources.map(untitledResource => ({ resource: untitledResource, options: { pinned: true } })));