Emacs, ENSIME and SBT

一世执手 提交于 2020-01-06 15:51:02

问题


I'm running Emacs + ENSIME and using sbt in an emacs window (M-x term) to compile and run tests. Is there any way to click/select to jump to the failing tests? At the moment I have to scroll up a long way to find what failed, then open the right file and go to the line number. Seems likely there is an easier way.

(Long term eclipse user trying to convert to emacs for Scala)


回答1:


You needn't install sbt.el: this functionality is built into ensime. Instead of running sbt in a shell, use

M-x ensime-sbt

This will find the project for the source file you are in and turn on the detection of error-messages automatically.




回答2:


I'm not sure how Emacs+Ensime does it, but the following Emacs plugin for sbt can parse compiler error results, so clicking on the error message jumps to an appropriate position in the failing source file.

https://github.com/stevej/emacs/blob/master/support/sbt.el

I believe that failing tests do not produce information about the file and the line number (but this depends what kind of tests you're running). If they could, perhaps this plugin could work, or be augmented to work..



来源:https://stackoverflow.com/questions/4112838/emacs-ensime-and-sbt

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