假设:
- 你当前编辑的文件是:
/home/your-username/your-project/folder/file.ext
/home/your-username/your-project
是你的workspace
(.vscode
文件夹所在的目录)
以下是环境变量
- ${workspaceFolder} -
/home/your-username/your-project
- ${workspaceFolderBasename} -
your-project
- ${file} -
/home/your-username/your-project/folder/file.ext
- ${relativeFile} -
folder/file.ext
- ${relativeFileDirname} -
folder
- ${fileBasename} -
file.ext
- ${fileBasenameNoExtension} -
file
- ${fileDirname} -
/home/your-username/your-project/folder
- ${fileExtname} -
.ext
- ${lineNumber} - line number of the cursor
- ${selectedText} - text selected in your code editor
- ${execPath} - location of Code.exe
原文地址:https://www.cnblogs.com/rookiezjz/p/12662558.html
时间: 2024-11-08 19:25:33