在哪里可以找到 settings-variable-reference visual studio 代码文档? (例如:$fileName、$fileNameWithoutExt)
Where can I find settings-variable-reference visual studio code documentation ? (e.g : $fileName, $fileNameWithoutExt)
我在 vs 代码中使用 Code Runner 扩展,
我想更改已编译的 cpp (.exe) 文件的输出目录,但我不知道我将输入什么变量名
- 我的“settings.json”文件:
"code-runner.executorMap": {
"javascript": "node",
"java": "cd $dir && javac $fileName && java $fileNameWithoutExt",
"c": "cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
"cpp": "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt", // <- this
有人知道这个案例的变量名文档在哪里吗?无论如何对不起我的英语不好
我试过从 https://code.visualstudio.com/docs/editor/variables-reference 开始实施,如下所示:
"cpp": "cd $dir && g++ $file -o $workspaceFolder\C++\bin\$fileNameWithoutExt && $workspaceFolder\C++\bin\$fileNameWithoutExt",
我得到了:
Unexpected token '\C++\bin\stringComparison' in expression or statement
formulahendry/vscode-code-runner: Code Runner for Visual Studio Code (github.com)
Supported customized parameters
- $workspaceRoot: The path of the folder opened in VS Code
- $dir: The directory of the code file being run
- $dirWithoutTrailingSlash: The directory of the code file being run without a trailing slash
- $fullFileName: The full name of the code file being run
- $fileName: The base name of the code file being run, that is the file without the directory
- $fileNameWithoutExt: The base name of the code file being run without its extension
- $driveLetter: The drive letter of the code file being run (Windows only)
- $pythonPath: The path of Python interpreter (set by
Python: Select Interpreter
command)
Please take care of the back slash and the space in file path of the executor
- Back slash: please use
\
- If there ares spaces in file path, please use
\"
to surround your file path
我在 vs 代码中使用 Code Runner 扩展,
我想更改已编译的 cpp (.exe) 文件的输出目录,但我不知道我将输入什么变量名
- 我的“settings.json”文件:
"code-runner.executorMap": {
"javascript": "node",
"java": "cd $dir && javac $fileName && java $fileNameWithoutExt",
"c": "cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
"cpp": "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt", // <- this
有人知道这个案例的变量名文档在哪里吗?无论如何对不起我的英语不好
我试过从 https://code.visualstudio.com/docs/editor/variables-reference 开始实施,如下所示:
"cpp": "cd $dir && g++ $file -o $workspaceFolder\C++\bin\$fileNameWithoutExt && $workspaceFolder\C++\bin\$fileNameWithoutExt",
我得到了: Unexpected token '\C++\bin\stringComparison' in expression or statement
formulahendry/vscode-code-runner: Code Runner for Visual Studio Code (github.com)
Supported customized parameters
- $workspaceRoot: The path of the folder opened in VS Code
- $dir: The directory of the code file being run
- $dirWithoutTrailingSlash: The directory of the code file being run without a trailing slash
- $fullFileName: The full name of the code file being run
- $fileName: The base name of the code file being run, that is the file without the directory
- $fileNameWithoutExt: The base name of the code file being run without its extension
- $driveLetter: The drive letter of the code file being run (Windows only)
- $pythonPath: The path of Python interpreter (set by
Python: Select Interpreter
command)Please take care of the back slash and the space in file path of the executor
- Back slash: please use
\
- If there ares spaces in file path, please use
\"
to surround your file path