mirror of
https://github.com/Microsoft/vscode
synced 2024-10-12 06:17:18 +00:00
fix #44812
This commit is contained in:
parent
b1c07c80be
commit
0af74d626a
|
@ -321,7 +321,12 @@ export class WorkbenchEditorService implements IWorkbenchEditorService {
|
|||
// Resource Editor Support
|
||||
const resourceInput = <IResourceInput>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;
|
||||
|
|
Loading…
Reference in a new issue