2016-04-20 7 views

答えて

4

あなたは、ワークスペースのルートからその位置を導き出すことができ、ファイルにアクセスする必要がある場合:この問題は、数ヶ月前に対処されている

"filelocation": "${workspaceRoot}/.vscode/tasks.json", 

// Available variables which can be used inside of strings. 
// ${workspaceRoot}: the root folder of the team 
// ${file}: the current opened file 
// ${fileBasename}: the current opened file's basename 
// ${fileDirname}: the current opened file's dirname 
// ${fileExtname}: the current opened file's extension 
// ${cwd}: the current working directory of the spawned process 
+0

こんにちは、私は "cwd"に変数が必要です – Well

1

https://github.com/Microsoft/vscode/issues/3119

新しい設定window.showFullPathが有効になると、ワークスペースの相対パスの代わりに現在開いているファイルのフルパスが表示されます。

この機能は、現在テスト中の11月リリースに出荷される予定です。その後、あなたの設定ファイルにwindow.showFullPathで制御できます。


UPDATE:私はオリジナルの答えを掲載するので

設定が変更されました。 window.titleと呼ばれ、好きなものをカスタマイズできます。

+0

私は "window.showFullPath"と書いた私のMacBookでこれは私にとってはうまくいきません:それは不明な設定です。 –

+0

@PeitiPeterLi私は半年以上前にこの回答を掲載しました。それ以来設定が変更されています。 ** window.title **と呼ばれるようになりました。あなたが好きなものをカスタマイズすることができます。 – Leo

3

window.titleは、ユーザー設定で私のために働いていた設定です:
"window.title": "${activeEditorMedium}"

その他のオプション:

// Controls the window title based on the active editor. Variables are substituted based on the context: 
    // ${activeEditorShort}: e.g. myFile.txt 
    // ${activeEditorMedium}: e.g. myFolder/myFile.txt 
    // ${activeEditorLong}: e.g. /Users/Development/myProject/myFolder/myFile.txt 
    // ${rootName}: e.g. myProject 
    // ${rootPath}: e.g. /Users/Development/myProject 
    // ${appName}: e.g. VS Code 
    // ${dirty}: a dirty indicator if the active editor is dirty 
    // ${separator}: a conditional separator (" - ") that only shows when surrounded by variables with values 
    "window.title": "${activeEditorShort}${separator}${rootName}", 
2

内のUserSettingsはJSONブロブに次の行を追加し、設定に移動:

"window.title": "$ {activeEditorLong}"

関連する問題