此类容为https://www.jianshu.com/p/21c99e461ad3 此处作者整理。
1.code runner 支持的自定义参数
Supported customized parameters | Description |
$workspaceRoot | 当前工程目录路径 |
$dir | 要运行的代码文件所在的目录 |
$dirWithoutTrailingSlash | 要运行的代码文件所在的目录(不带尾后斜杆) |
$fullFileName | 要运行的代码文件全路径 |
$fileName | 要运行的代码文件名称 |
$fileNameWithoutExt | 要运行的代码文件名称(不带后缀名) |
$driveLetter | 要运行的代码文件所在盘符(只用于 Windows 系统) |
$pythonPathPython | 解释器路径 |
2.常见语言运行配置:
{
"code-runner.executorMap": {
"javascript": "node",
"php": "C:\\php\\php.exe",
"python": "python",
"perl": "perl",
"ruby": "C:\\Ruby23-x64\\bin\\ruby.exe",
"go": "go run",
"html": "\"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe\"",
"java": "cd $dir && javac $fileName && java $fileNameWithoutExt",
"c": "cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt"
}
}