How To: debug Scala code when outside of an IDE

ぃ、小莉子 提交于 2019-12-18 11:44:53

问题


I'm experimenting with using jEdit as my main editor for writing Scala code.

Along side jEdit I'm using Apache Buildr and DTerm. This all works well, except I'm really not sure how I would go about debugging Scala application outside of a large IDE?

Are there recommended practices/tools for debugging outside of an IDE?


回答1:


I am not sure you can debug entirely through the CLI. Any Java-based debug tool should be enough.

This SO question mentions jswat, which also has a console mode.
It is used in this blog entry and can be installed quite easily as illustrated here.




回答2:


Rather than using a debugger, you could run the interpreter (aka REPL) from a point in your application. You can find detailed instructions here




回答3:


There was a stack overflow question from years ago about a CLI Scala debugger. I just posted a new answer to it back in February about a new CLI called sdb that mimics jdb behaviour while providing support for Scala name demangling and other improvements.

Is there a Scala command-line debugger?


The answer from that topic was

Old question, but here is sdb, which is a jdb clone written in Scala using the Ensime debugger api: https://github.com/ensime/scala-debugger/releases/tag/v1.1.0-M3

And the sbt plugin: https://github.com/ensime/scala-debugger/releases/tag/v1.1.0-M3-2



来源:https://stackoverflow.com/questions/2272705/how-to-debug-scala-code-when-outside-of-an-ide

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!