editors - document why we activate

This commit is contained in:
Benjamin Pasero 2021-08-02 15:46:49 +02:00
parent bd5df047b3
commit cc010a76d8
No known key found for this signature in database
GPG key ID: E6380CC4C8219E65

View file

@ -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)) {