开源项目 在 VS Code 中调试 Ruby/Rails/etc

rebornix · 2016年02月28日 · 最后由 Vucius 回复于 2018年11月13日 · 9510 次阅读

周末造了个轮子,给 VS Code 添加 debug Ruby 的功能,来这里献丑了 :)

VS Code 把 NodeJS 和 Mono 的调试功能抽象出来了,大家就可以通过自定义 Debugger Adapter 和 VSCode Debug Protocol 从而实现自己的调试器。现在 VS Code 插件中心 里,Go、PHP、Python 的 Debugger 做的都比较成熟了,但是 Ruby 的还没有人动手。于是这个周末花了点时间,做出了各原型发布了。

原理和 RubyMine 基本一致,通过 ruby-debug-ide 和 ruby-debug 通讯从而控制 ruby 代码的执行,integrate 到 VS Code 中要做的就是把这些指令的发布和结果的解析加到 VS Code 的 debug session 中。

代码在 GitHub 上,发布的第一个原型在 VS Code Marketplace

撸 Ruby 没多久,还望大家多多指教。如果有和我一样比较喜欢用 IDE 的朋友,欢迎来一起造这个轮子。

消除零回复 >..<

这周完成了 Ruby scripts 的基本调试功能

  • Line breakpoints (add, delete, disable, enable)
  • Step over, step in, step out, continue
  • Multiple, parallel threads
  • Call stack
  • Scope variables
  • Debug console
  • Watch window
  • Variables evaluate/inspect

接下来将要支持一下功能:

  • Ruby scripts debugging
    • Conditional breakpoints
    • Break on entry
    • Breaking on uncaught exceptions and errors
    • Attach requests
  • Ruby remote debug
  • Unit/Integration tests debugging
    • RSpec
    • Cucumber
    • Shoulda
    • Test::Unit
  • Rack
  • Rails
  • Rake
  • Gem
  • IRB console
  • IntelliSense and autocomplete
  • Linting

这周有了比较大的更新,支持了 Remote debugging 以及 Rails:

现在的支持列表是:

  • Ruby scripts debugging
    • Line breakpoints (add, delete, disable, enable)
    • Step over, step in, step out, continue, pause
    • Multiple, parallel threads
    • Call stack
    • Scope variables
    • Debug console
    • Watch window
    • Variables evaluate/inspect
    • Stop on entry
    • Breaking on uncaught exceptions and errors
    • Attach requests
  • Ruby remote debug
  • Rails

安装量刚刚破一千,获得了 Ruby Weekly 的收录 😄

#3 楼 @rebornix 👍🏻👍🏻👍🏻

链接全掉了 https://github.com/rubyide/vscode-ruby 然后这上面的配置也有些过时了~求更新

需要 登录 后方可回复, 如果你还没有账号请 注册新账号