Eglot has landed on master: Emacs now has a built-in LSP client

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • Elpy

    Emacs Python Development Environment

  • eight-ball

    interactive Magic 8-Ball function for Emacs

  • I put the question to the Emacs magic eight ball (https://github.com/RyanMatlock/eight-ball) and the answer was yes!

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • .emacs.d

    My personal emacs settings, and the ones used in @emacsrocks (by magnars)

  • eglot

    A client for Language Server Protocol servers

  • At least for web development I believe eglot is strictly worse. It does not support running multiple servers (e.g. tsserver and eslint-ls) (https://github.com/joaotavora/eglot/issues/976) which is supported by lsp-mode and neovim's built-in lsp client. Also, it does not have any equivalent to dap-mode which is lsp-mode only. Although worth noting dap-mode is currently useless for js (https://github.com/emacs-lsp/dap-mode/issues/369).

  • dap-mode

    Emacs :heart: Debug Adapter Protocol

  • At least for web development I believe eglot is strictly worse. It does not support running multiple servers (e.g. tsserver and eslint-ls) (https://github.com/joaotavora/eglot/issues/976) which is supported by lsp-mode and neovim's built-in lsp client. Also, it does not have any equivalent to dap-mode which is lsp-mode only. Although worth noting dap-mode is currently useless for js (https://github.com/emacs-lsp/dap-mode/issues/369).

  • direnv

    unclutter your .profile

  • I've had a good experience with direnv[1] and emacs-direnv[2].

    Direnv can automatically load an environment when you enter a directory, so it automatically "opens" virtualenvs/nix shells/etc. The Emacs direnv mode ensures that each buffer sees the direnv mode for its project directory.

    I've found this to be a great compromise between automatic behavior on the one hand and transparency + control on the other—I get the right environment loaded automatically very consistently and, if something goes wrong, I can open a shell and poke around to see what's going on (is my nix shell messed up? is the right tool not loaded via direnv? etc). The only time I need to do anything manually is if I make a change to the environment and need to update Emacs about it, in which case I just run M-x direnv-update-environment.

    Once I got this set up, I can just rely on executable-find to check for (and find) exactly the right tool on a per-project basis—no more worrying about global or seeing the wrong version of a tool. This also made it easy to do stuff like only run formatting if the corresponding tool is available: I add hooks to various programming language modes that only turn on lsp/formatting/etc if executable-find sees the corresponding executable.

    Compared to the hassle I've had to go through helping my colleagues debug VSCode not seeing the right conda environment, virtualenv or the right version of various tools, Emacs + direnv has been a far nicer and more consistent experience.

    [1]: https://direnv.net/

    [2]: https://github.com/wbolster/emacs-direnv

  • emacs-direnv

    direnv integration for emacs

  • I've had a good experience with direnv[1] and emacs-direnv[2].

    Direnv can automatically load an environment when you enter a directory, so it automatically "opens" virtualenvs/nix shells/etc. The Emacs direnv mode ensures that each buffer sees the direnv mode for its project directory.

    I've found this to be a great compromise between automatic behavior on the one hand and transparency + control on the other—I get the right environment loaded automatically very consistently and, if something goes wrong, I can open a shell and poke around to see what's going on (is my nix shell messed up? is the right tool not loaded via direnv? etc). The only time I need to do anything manually is if I make a change to the environment and need to update Emacs about it, in which case I just run M-x direnv-update-environment.

    Once I got this set up, I can just rely on executable-find to check for (and find) exactly the right tool on a per-project basis—no more worrying about global or seeing the wrong version of a tool. This also made it easy to do stuff like only run formatting if the corresponding tool is available: I add hooks to various programming language modes that only turn on lsp/formatting/etc if executable-find sees the corresponding executable.

    Compared to the hassle I've had to go through helping my colleagues debug VSCode not seeing the right conda environment, virtualenv or the right version of various tools, Emacs + direnv has been a far nicer and more consistent experience.

    [1]: https://direnv.net/

    [2]: https://github.com/wbolster/emacs-direnv

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • estree

    The ESTree Spec

  • That was a super interesting link, thank you.

    For the ontological problem, I presume you're referring to how there are so many differing ideas of how to represent ASTs (apologies for mixing languages, these URLs were just handy):

    * https://lisperator.net/uglifyjs/ast#nodes

    * https://github.com/estree/estree#the-estree-spec

    * ... likely others

    which makes it hard for ls1 to ask ls2 about "the for-of iteration variable Node" because ls2 could be using UglifyJS or ESTree or their own(!) AST nomenclature?

    And all of this is made worse by (e.g.) Java1.3 versus Java19 because languages are rarely static

  • editorconfig-emacs

    EditorConfig plugin for Emacs

  • > My only complaint is that I can never get Emacs's indentation to match what Prettier wants to do, so I'll type a bunch of code, prettier-on-save, and everything gets moved around.

    I had this same issue, and it was annoying enough I continued to use https://github.com/editorconfig/editorconfig-emacs alongside prettier.

    This does create another annoyance in having to configure editorconfig for new projects instead of relying on prettier alone.

  • eslint-flymake

    An ESLint backend for Flymake

  • > Why wouldn't you want the lint error to be highlighted right as you type the code?

    Why do you think you need to involve an LSP for that?. ESLint, as most linters, can take their input from stdin. That is exactly how the eslint-flymake[0] works. Lint on buffer contents, not file on disk. No JSON RPC involved.

    0: https://github.com/emacs-pe/eslint-flymake/

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts