From 0af74d626a8b3d3aa992531198004de10569fca7 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Thu, 1 Mar 2018 11:44:36 +0100 Subject: [PATCH] fix #44812 --- src/vs/workbench/services/editor/common/editorService.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/services/editor/common/editorService.ts b/src/vs/workbench/services/editor/common/editorService.ts index b7ee6593ae8..5ddaced115d 100644 --- a/src/vs/workbench/services/editor/common/editorService.ts +++ b/src/vs/workbench/services/editor/common/editorService.ts @@ -321,7 +321,12 @@ export class WorkbenchEditorService implements IWorkbenchEditorService { // Resource Editor Support const resourceInput = input; if (resourceInput.resource instanceof URI) { - return this.createOrGet(resourceInput.resource, this.instantiationService, resourceInput.label || basename(resourceInput.resource.fsPath), resourceInput.description, resourceInput.encoding); + let label = resourceInput.label; + if (!label && resourceInput.resource.scheme !== Schemas.data) { + label = basename(resourceInput.resource.fsPath); // derive the label from the path (but not for data URIs) + } + + return this.createOrGet(resourceInput.resource, this.instantiationService, label, resourceInput.description, resourceInput.encoding); } return null;