Escape IntelliJ: Seamless Scala and Kotlin Development with Emacs Eglot

Escape IntelliJ: Scala and Kotlin LSPs on Emacs Eglot

I share my production-ready Emacs Eglot setup for Scala and Kotlin, proving you don't need IntelliJ IDEA for JVM languages. By leveraging the Unix philosophy and custom Emacs Lisp workarounds, I achieve a lightweight, fast, and highly hackable development environment. This configuration handles complex server quirks, optimizes memory usage, and delivers a unified interface that rivals monolithic IDEs while keeping your system responsive.

If IntelliJ has a bug in how it auto-completes Kotlin code, you are stuck waiting for JetBrains to issue a patch. In Emacs, you can write a 10-line Lisp advice function to intercept the network payload and patch the bug live in your editor buffer.
  1. sajithdilshan

    > But what do you actually get with IntelliJ? A massive, monolithic Java application that frequently hogs 8GB+ of RAM, locks up your system while “indexing pre-built binaries,” and forces you into a closed proprietary ecosystem.

    This is just exaggeration. I use IntelliJIDEA everyday (on mac) with multiple projects open and tbh they have optimized the IDE a lot to make it faster. I'm not saying it's perfect, but it's getting better. Also it's not closed source. The core of the IDE is open source (https://github.com/jetbrains/intellij-community) and for some specific framework support (e.g. Spring) are available on Ultimate.

  2. laszlojamf

    I agree that IntelliJ is a monster of a resource hog, but I have yet to find an editor where code navigation is as good. That's basically all I use it for these days, in the days of LLMs, and I still think it's worth it. VSCode, especially for golang, is terrible. I might be holding it wrong, but I've really tried, and it's just not good enough.

    Before LLMs, when I still refactored by hand, coworkers who were using vim or vscode used to ask me to do big refactors, because IntelliJ always got it right, whereas with the other editors it was hit-or-miss.

  3. DrProtic

    People will go to great lengths to avoid paying for what is, arguably, an outstanding product from a great company, then think nothing of spending the same amount at Starbucks.

    I don’t think I’ve ever seen a company scrutinized and nitpicked as much as JetBrains.

  4. marginalia_nu

    The fact we still don't have a decent Java language server is one of my canaries for the fact that LLMs still, generally speaking, can't ship. There is undeniably demand for this sort of thing, but nobody is coming to meet it. (jdtls, bless it for trying, is just not good)

  5. phmx

    The Metals documentation includes instructions for setting it up with Emacs. I followed them, and everything works, including worksheets.

    https://scalameta.org/metals/docs/editors/emacs

  6. microflash

    As a very heavy user of IntelliJ and associated family of IDEs, I’d say they are extremely bloated compared to a few years ago. My latest annoyance with IDEA has been extremely slow disk sync. If I edit something outside the IDE, it takes a while to appear in it.

    They should cut down the binary size and ship a leaner version without all the bundled plugins. They should improve performance on extremely large projects (both memory and IO).

    Although I have let my personal Ultimate subscription expire, I still use it at work because debugger, codenav and autocompletion are still best in class.

  7. tecleandor

    I'm trying to avoid IntelliJ because I only need it for editing TeamCity build configuration files, that are written in a Kotlin based DSL [0], and autocomplete and linting are be very helpful.

    I've tried Eclipse and VS Code but I don't get them to autocomplete or detect syntax correctly. Would any LSP help me with that? As I have no idea about Java, Kotlin or Gradle, everything is kinda confusing to me...

    --

    0: https://www.jetbrains.com/help/teamcity/kotlin-dsl.html

  8. minraws

    I wrote an LSP for kotlin and java recently and it's so annoying how tightly coupled all the LSP stuff is in IntelliJ to the IDE itself they have a outside LSP project which seems to be going very slow or nowhere is very sad.

    Note I tried to use IntelliJ to build it the performance was not nearly as nice as I would have liked still better than a lot of LSPs but still.

    I know a bunch of folks have tried it but I think only Jetbrains can build a good one, unless someone actually goes all in on solving this for a few months and rebuilds the parsing and types systems outside of the Jetbrains toolchain and ecosystem.

    Java is likely easier but it's also quite jank in terms of how existing solutions work.

    But I like projects like this, I am not against IntelliJ it must be great had been great when I was learning but I want a lsp to use for scripts and the small edits, opening a massive IDE is very overkill for the kinds of small changes I like to make now.

More from this day

2026-07-23