Code Runner for VS Code, 支持运行 27 种语言 (C, C++, Java , JS, PHP , Python , Perl, Ruby, Go, Lua, Groovy, PowerShell...)

2017-01-14 12:36:32 +08:00
 formulahendry

经过了半年的打磨,Code Runner已经支持了 27 种语言: C, C++, Java, JS, PHP, Python, Perl, Ruby, Go, Lua, Groovy, PowerShell, BAT/CMD, BASH/SH, F#, C#, VBScript, TypeScript, CoffeeScript, Scala, Swift, Julia, Crystal, OCaml, R, AppleScript, Elixir 。并且支持以下几个主要功能:

如果大家发现了任何 bug 或者有什么建议,欢迎来GitHub给我提 issue 或者 PR 。

17693 次点击
所在节点    程序员
59 条回复
icreeper
2017-01-15 14:07:01 +08:00
感觉比 CodeRunner2 还好用!赞一个
formulahendry
2017-01-15 22:42:22 +08:00
@icreeper 😎😎
manongvpn
2017-01-16 07:53:22 +08:00
大牛
araraloren
2017-01-16 09:30:09 +08:00
看起来不错的样子,最近也有点使用 VSCODE 的兴趣~~ mark 一下
coa
2017-01-16 22:14:08 +08:00
这个强, Code Runner 2 胜在支持 Objective C ,可惜收费。。求问 Atom 下有没有类似的东西。。。
hambut
2017-02-07 11:05:59 +08:00
@formulahendry vs2015 没找到 CTRL+P ,怎么安装。。。
formulahendry
2017-02-07 11:38:15 +08:00
@hambut 这个插件是 Visual Studio Code 的: https://code.visualstudio.com/ ,不是 VS IDE 😅
hambut
2017-02-07 14:47:00 +08:00
@formulahendry #47 好尴尬啊。。刚才下了 VS CODE 试了下,别的都挺满意, CTRL SHIFT O 有些认不出来,没有 minimap 暂时性流失。。
formulahendry
2017-02-07 15:58:45 +08:00
@hambut 看什么语言了吧, Node.js 有 built-in 支持,其它语言的'Go to Symbol'还是要另外装插件
vito0719
2017-05-11 16:02:12 +08:00
能在 windows 下运行 swift 吗?
formulahendry
2017-05-12 00:02:43 +08:00
@vito0719 Bash on Windows :)
vito0719
2017-05-12 18:13:52 +08:00
@formulahendry 我在 bash 里已经可以用 swift 了,请问在 vs code 里还需要改什么?
formulahendry
2017-05-13 20:00:13 +08:00
@vito0719
1. 设置 Integrated Terminal 用 Bash on Ubuntu (on Windows): https://code.visualstudio.com/docs/editor/integrated-terminal#_windows:"terminal.integrated.shell.windows": "C:\\Windows\\sysnative\\bash.exe"
2. 设置 Code Runner 用 Integrated Terminal:"code-runner.runInTerminal": true
formulahendry
2017-05-13 20:01:00 +08:00
vito0719
2017-05-15 15:15:03 +08:00
@formulahendry 好像问题是路径?我运行得到的回复是这样的:
Playground.swift"-CZZ:/mnt/c/Users/vito0719$ swift "c:\Users\vito0719\Documents\
<unknown>:0: error: no such file or directory: 'c:\Users\vito0719\Documents\Playground.swift'

好像要改成 /mnt/c/Users/这样的路径才行,这个有方法吗?
formulahendry
2017-05-15 22:35:58 +08:00
@vito0719 的确目前有 limitation,现在有 issue 在 track: https://github.com/formulahendry/vscode-code-runner/issues/106
jin7
2017-07-22 23:53:52 +08:00
@formulahendry 嗨~. 我发现 powershell 中文乱码了.
ps1 文件, 编码是 ucs2-le, 代码页是 1200
设置
```
"code-runner.runInTerminal": true,
"code-runner.executorMap": {
"powershell": "chcp 1200>nul && powershell -ExecutionPolicy ByPass -File"
}
```
输出是一行乱码: ��Ч����ҳ
设置成 chcp 65001 可以输出, 只是中文当作 ansi 编码解析了.

为什么我要把 ps1 文件保存为 ucs2-le 编码, 因为, powershell 好像不认 utf8 编码, 中文会乱码. 用 ucs2-le 就没事.
jin7
2017-07-23 11:13:21 +08:00
我发现 chcp 1200 为无效代码页.
但是我把文件保存为 utf8, 并且设置如下, 也没有用
```
"code-runner.runInTerminal": true,
"code-runner.executorMap": {
"powershell": "chcp 65001>nul && powershell -ExecutionPolicy ByPass -File"
}
```
bestswifter
2018-03-11 17:21:12 +08:00
可否把 runCustomCommand 命令和 run 命令的快捷键设置为同一个呢?

我有一个需求是,如果没有指定 customCommand,就按照 executorMap 里面的配置来执行,如果有 customCommand,则优先执行 customCommand。

我知道 keybindings.json 里面有一个 when 字段,但是不知道该填什么值

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/334547

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX