I’ve added a bunch of updates to the elm-language-server I’ve created, some cool gifs to show off the various features.
I created it with the goal of having something as fast and reliable as the Elm compiler to use in editors on a specific large codebase (~300klc + another ~300kloc of generated code), where existing solutions did not cut it.
Since last time I talked about it on elm-slack, support for document symbols, formatting (via elm-format) and the ability to rename some things, along with various fixes to existing systems, have been added.
If you want to try it out, I’ve got a binary for apple silicon in the release, since that’s what I use myself. There are instructions with the versions of Haskell tools that can be used and also instructions for building it with Nix.
For what’s next, I intend to look into improving caching and am considering hover type inference.
It’s an accounting kind of a product. We have about 250 pages (Model, init, Msg, update, view), a few kind of just wrap common components used between multiple pages.
A smart move I think to base it off the Elm compiler, as that already has so much of what a language server needs.
Which IR does your language server use, is it the Canonical IR ?
I know my way around the compiler code quite well from working on the Guida Elm port - which areas would I look in to see the bulk of the language server code you have added ? Just curious to take a look and see.
It uses the source AST for all the features. I’ve done a proof-of-concept level type inference thing, that requires doing things with the canonical representation.
I also recently removed warnings (missing types, unused imports and such), which were based on canonical and optimized stuff. I think that functionality was copied from elm-dev, and too slow for the way the server currently works.
I’m trying it out on my system. It has the same name as the regular elm-language-server, so I didn’t have to change anything in my editor (helix) to use it.
Zed was really slow to show references for me, it got them in under a second from the server and then took like 30 to display them. Not sure what that is about.
I haven’t created a release / binaries for the jsonrpc version commit yet.