文档: https://github.com/formulahendry/vscode-code-runner 常用设置
// 运行之前保存文件
"code-runner.saveFileBeforeRun": true,
// 清空控制台
"code-runner.clearPreviousOutput": true,
// 指定Python解释器
"code-runner.executorMap": {
"python": "/Users/.pyenv/versions/py370/bin/python3",
},
快捷键
运行快捷键改为: control + r
用以下文件测试都可以顺利执行
demo.js
console.log("hello world");
demo.py
print("hello world");
demo.php
<?php
echo "hello world";