提交 6ee4d1fe 编写于 作者: B Benjamin Pasero

vue tour - avoid "." for non file editors as description

上级 7827962b
......@@ -248,12 +248,15 @@ export class WorkbenchEditorService implements IWorkbenchEditorService {
// Treat an URI as ResourceEditorInput
else if (resourceInput.resource instanceof URI) {
return TPromise.as(this.instantiationService.createInstance(
ResourceEditorInput,
resourceInput.label || basename(resourceInput.resource.fsPath),
typeof resourceInput.description === 'string' ? resourceInput.description : dirname(resourceInput.resource.fsPath),
resourceInput.resource
));
const label = resourceInput.label || basename(resourceInput.resource.fsPath);
let description: string;
if (typeof resourceInput.description === 'string') {
description = resourceInput.description;
} else if (resourceInput.resource.scheme === network.Schemas.file) {
description = dirname(resourceInput.resource.fsPath);
}
return TPromise.as(this.instantiationService.createInstance(ResourceEditorInput, label, description, resourceInput.resource));
}
return TPromise.as<EditorInput>(null);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册