Skip to content

WhileTruu/elm-language-server

 
 

Repository files navigation

🚧 WhileTruu's Elm language server 🚧

An experimental language server implementation for the Elm programming language.

Why?

A language server should be fast and reliable. The Elm compiler is both of those things, a language server built from it might be as well.

Features ✨

  • 🧭 Go to definition
  • 🔍 Find references
  • 🛡️ Diagnostics (errors and warnings)

Try it out quickly via Nix

If you have Nix installed and flakes enabled (which is the default when installing with the Determinate Systems Installer), you can easily compile and run this project without installing it or its build tools.

First, run the following command to make sure your system is able to fetch and build everything. This could take a few minutes the first time you run it:

nix run github:WhileTruu/elm-language-server -- --help

You should see a bunch of activity as Nix downloads and builds things, and then a short message from the language server, like this:

Start the Elm language server:

    elm-language-server

The server listens on stdin.

Great! It works. Now, pick one of the following methods to make your IDE/editor's LSP integration use the language server:

  1. Configure your IDE to use this command for the Elm language server:

    nix run github:WhileTruu/elm-language-server
    
  2. For an editor that inherits environment from your command line, you can also start a sub-shell with elm-language-server available in PATH, and then start your editor from within that shell. For instance, by running:

    nix shell github.com:WhileTruu/elm-language-server
    nvim ./src/Main.elm
    

    You may need to alter your settings to use elm-language-server as the elmls command in your LSP configuration.

Install

Prerequisites

  • GHC version 9.2.8
  • Cabal version 3.10.3.0

Build

cabal new-build --ghc-option=-split-sections seems to work!

Acknowledgements

These projects were of a lot of help:

About

Fork of the elm compiler, repurposed for a language server.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Haskell 95.0%
  • Elm 3.2%
  • NSIS 0.5%
  • Nix 0.3%
  • JavaScript 0.3%
  • Shell 0.2%
  • Other 0.5%