Option to show project path in title bar (fixes #21002)

This commit is contained in:
Benjamin Pasero 2017-02-22 07:47:30 +01:00
parent d744666d35
commit 256d76fed7
3 changed files with 8 additions and 3 deletions

View file

@ -39,7 +39,8 @@ export class SettingsDocument {
const completions: vscode.CompletionItem[] = [];
completions.push(this.newSimpleCompletionItem('${activeEditorName}', range, localize('activeEditorName', "e.g. myFile.txt")));
completions.push(this.newSimpleCompletionItem('${activeFilePath}', range, localize('activeFilePath', "e.g. /Users/Development/myProject/myFile.txt")));
completions.push(this.newSimpleCompletionItem('${activeFilePath}', range, localize('activeFilePath', "e.g. /Users/Development/myProject/myFolder/myFile.txt")));
completions.push(this.newSimpleCompletionItem('${activeFilePathRelative}', range, localize('activeFilePathRelative', "e.g. /Users/Development/myProject/myFolder/myFile.txt")));
completions.push(this.newSimpleCompletionItem('${rootName}', range, localize('rootName', "e.g. myProject")));
completions.push(this.newSimpleCompletionItem('${rootPath}', range, localize('rootPath', "e.g. /Users/Development/myProject")));
completions.push(this.newSimpleCompletionItem('${appName}', range, localize('appName', "e.g. VS Code")));

View file

@ -152,7 +152,8 @@ export class TitlebarPart extends Part implements ITitleService {
* Possible template values:
*
* {activeEditorName}: e.g. myFile.txt
* {activeFilePath}: e.g. /Users/Development/myProject/myFile.txt
* {activeFilePath}: e.g. /Users/Development/myProject/myFolder/myFile.txt
* {activeFilePathRelative}: e.g. myFolder/myFile.txt
* {rootName}: e.g. myProject
* {rootPath}: e.g. /Users/Development/myProject
* {appName}: e.g. VS Code
@ -167,6 +168,7 @@ export class TitlebarPart extends Part implements ITitleService {
// Variables
const activeEditorName = input ? input.getName() : '';
const activeFilePath = file ? this.tildify(labels.getPathLabel(file)) : '';
const activeFilePathRelative = file ? labels.getPathLabel(file, this.contextService) : '';
const rootName = workspace ? workspace.name : '';
const rootPath = workspace ? this.workspacePath : '';
const dirty = input && input.isDirty() ? TitlebarPart.TITLE_DIRTY : '';
@ -176,6 +178,7 @@ export class TitlebarPart extends Part implements ITitleService {
return labels.template(this.titleTemplate, {
activeEditorName,
activeFilePath,
activeFilePathRelative,
rootName,
rootPath,
dirty,

View file

@ -200,7 +200,8 @@ Note that there can still be cases where this setting is ignored (e.g. when usin
'description': nls.localize({ comment: ['This is the description for a setting. Values surrounded by parenthesis are not to be translated.'], key: 'title' },
`Controls the window title based on the active editor. Variables are substituted based on the context:
\${activeEditorName}: e.g. myFile.txt
\${activeFilePath}: e.g. /Users/Development/myProject/myFile.txt
\${activeFilePath}: e.g. /Users/Development/myProject/myFolder/myFile.txt
\${activeFilePathRelative}: e.g. myFolder/myFile.txt
\${rootName}: e.g. myProject
\${rootPath}: e.g. /Users/Development/myProject
\${appName}: e.g. VS Code