简体   繁体   中英

Emacs, ENSIME and SBT

I'm running Emacs + ENSIME and using sbt in an emacs window (Mx 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)

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.

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..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM