Wel*_*ell 6 visual-studio-code
我想在VS Code中创建任务,但我需要实际文件的路径.这里有一些选择吗?我的任务:
{
"version": "0.1.0",
"command": "${workspaceRoot}/run.sh",
"isShellCommand": true,
"options": {
"cwd": "${hereINeedPathToActualFile}"
},
"args": ["${file}"],
"showOutput": "always"
}
Run Code Online (Sandbox Code Playgroud)
非常感谢
man*_*ire 13
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}",
Run Code Online (Sandbox Code Playgroud)
如果您需要访问文件,您可以从工作区根目录获取其位置:
"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
Run Code Online (Sandbox Code Playgroud)
这个问题几个月前就已经得到解决:
有一个新设置
window.showFullPath,启用后将显示当前打开文件的完整路径,而不是工作区相对路径。
该功能计划在 11 月版本中发布,目前正在测试中。window.showFullPath然后你可以在配置文件中控制它。
更新:
自从我发布原始答案以来,设置已更改。它现在称为window.title,您可以自定义任何您喜欢的内容。
| 归档时间: |
|
| 查看次数: |
10477 次 |
| 最近记录: |