From cc010a76d8e86919bfa4c5007974ee76bb2f34d5 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 2 Aug 2021 15:46:49 +0200 Subject: [PATCH] editors - document why we activate --- src/vs/workbench/common/editor.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/common/editor.ts b/src/vs/workbench/common/editor.ts index 8bf13afeca2..6057b6548b6 100644 --- a/src/vs/workbench/common/editor.ts +++ b/src/vs/workbench/common/editor.ts @@ -1093,11 +1093,13 @@ export async function pathsToEditors(paths: IPathData[] | undefined, fileService const editors = await Promise.all(paths.map(async path => { const resource = URI.revive(path.fileUri); - if (!resource) { return; } + // Since we are possibly the first ones to use the file service + // on the resource, we must ensure to activate the provider first + // before asking whether the resource can be handled. await fileService.activateProvider(resource.scheme); if (!fileService.canHandleResource(resource)) {