Best scala editor for daily use

What is the best editor for scala?

Editors I am familiar with (and like) - Intellij Idea Community, vim, VS Code. (I am open to trying new editors)

I always find it more convenient to write bigger projects using a full featured IDE (mainly because of being able to play with the directory structure and refactoring), so in this question I am talking about single scripts and smaller sized projects. - Considering that I would be using Intellij Idea Community for bigger projects. (If you feel there is something better please let me know).

As a background to this question, I had trouble writing java in Vim as the linter and the code highlighting always seemed a little off to me. If vim is a suitable option could you recommend plugins?

I have a powerful computer, so resource efficiency is not a factor.

(No I do not like Idea with vim bindings. Also, I had some trouble setting up the metals plugin on vim.)

There is Ensime, which is a plugin for several editors, including Vim and VSCode (with a bit differing feature set, the main target being Emacs, but the essential stuff is there in vim). I haven’t used it much, as I am fine with the vim bindings on Idea most of the time, but completion and highlighting were fine. It sometimes used a lot of resources and disk space. A colleague of mine uses it for everything, including larger projects.

Another vim plugin I came upon recently is ALE, which is an asynchronous linter for several languages. I tested it only with Haskell yet, but it lists several available Scala linters (fsc, sbtserver, scalac, scalafmt, scalastyle). For Haskell it works well and allows showing errors as you type, similar to an IDE, but it requires a recent vim ≥ 8 or neovim.

I use vs-code with Metals and it works well for me.

1 Like

You posted this on Reddit too, right? I answered there: https://www.reddit.com/r/scala/comments/adfll5/scala_editor/edh9nf4/

Inteligencia idea :grin:

1 Like

I asked myself this question a while ago. Like you I use Intellij for larger projects but I much prefer Vim or VS Code for hacking. I ended up writing my own plugins, which you might like (shameless plug):

https://github.com/buntec/neovim-scalavista

https://github.com/buntec/vscode-scalavista

1 Like

How does scalavista-server compare to metals?

1 Like

Similar to ENSIME and Scala IDE for Eclipse, Scalavista uses Scala’s Presentation Compiler. This means that your code is run through the first few phases of compilation as you type. Since the compiler knows about the types and symbols in your code, it can readily provide type information and type/scope completions as well as warnings and errors. As far as I know, Metals does not currently provide type information or completions, which is a deal-breaker for me even for small projects.

I sticked to Intellij IDEA, but vscode + metals work really fast and smoove

I use neovim with metals and tabnine (https://tabnine.com/) and recommend it highly.

Does Scalavista support debugging? Metals seems to be not supporting debugging yet.
I am using Windows’ WSL and VSCode for other languages, but struggling with Scala :frowning:

Unfortunately not - sorry.