diff --git a/src/vs/workbench/parts/files/browser/views/openEditorActions.ts b/src/vs/workbench/parts/files/browser/views/openEditorActions.ts index bcf391675da3cea106f6a6dcbb600aeaa07350e2..ece27d0014d7477e3270f152686d1d78c6870213 100644 --- a/src/vs/workbench/parts/files/browser/views/openEditorActions.ts +++ b/src/vs/workbench/parts/files/browser/views/openEditorActions.ts @@ -30,14 +30,6 @@ export class OpenEditor { return `openeditor:${this.group.id}:${this.editor.getName()}:${this.editor.getDescription()}`; } - public getName(): string { - return this.editor.getName(); - } - - public getDescription(): string { - return this.editor.getDescription(); - } - public isPreview(): boolean { return this.group.isPreview(this.editor); } @@ -45,9 +37,21 @@ export class OpenEditor { public isDirty(textFileService: ITextFileService, untitledEditorService: IUntitledEditorService): boolean { if (this.editor instanceof FileEditorInput) { return textFileService.isDirty((this.editor).getResource()); + } else if (this.editor instanceof UntitledEditorInput) { + return untitledEditorService.isDirty((this.editor).getResource()); + } + + return false; + } + + public getFsPath(): string { + if (this.editor instanceof FileEditorInput) { + return (this.editor).getResource().fsPath; + } else if (this.editor instanceof UntitledEditorInput) { + return (this.editor).getResource().fsPath; } - return untitledEditorService.isDirty((this.editor).getResource()); + return ''; } } diff --git a/src/vs/workbench/parts/files/browser/views/openEditorsViewer.ts b/src/vs/workbench/parts/files/browser/views/openEditorsViewer.ts index 0962613eab2c6cd4e2794743ac08e8291cdebcce..9167ba7f7217e380b61c9d8d6d1844f1bd46efd1 100644 --- a/src/vs/workbench/parts/files/browser/views/openEditorsViewer.ts +++ b/src/vs/workbench/parts/files/browser/views/openEditorsViewer.ts @@ -129,8 +129,9 @@ export class Renderer implements tree.IRenderer { private renderOpenEditor(tree: tree.ITree, editor: OpenEditor, templateData: IOpenEditorTemplateData): void { editor.isPreview() ? dom.addClass(templateData.root, 'preview') : dom.removeClass(templateData.root, 'preview'); editor.isDirty(this.textFileService, this.untitledEditorService) ? dom.addClass(templateData.root, 'dirty') : dom.removeClass(templateData.root, 'dirty'); - templateData.name.textContent = editor.getName(); - templateData.description.textContent = editor.getDescription(); + templateData.root.title = editor.getFsPath(); + templateData.name.textContent = editor.editorInput.getName(); + templateData.description.textContent = editor.editorInput.getDescription(); templateData.actionBar.context = editor; } @@ -262,7 +263,7 @@ export class AccessibilityProvider implements tree.IAccessibilityProvider { return nls.localize('editorGroupAriaLabel', "{0}, Editor Group", (element).label); } - return nls.localize('openEditorAriaLabel', "{0}, Open Editor", (element).getName()); + return nls.localize('openEditorAriaLabel', "{0}, Open Editor", (element).editorInput.getName()); } }