scohen
Lexical - A Language Server for Elixir
Lexical
Lexical is a next-generation language server for the Elixir programming language.
Features
- Context aware code completion
- As-you-type compilation
- Advanced error highlighting
- Code actions
- Code Formatting
- Go To Definition
- Completely isolated build environment
What makes Lexical different?
There are a couple things that lexical does differently than other language servers. Let’s look at what separates it from the pack.
Architecture
When lexical starts, it boots an erlang virtual machine that runs the language server and its code. It then boots a separate virtual machine that runs your project code and connects the two via distribution. This provides the following benefits:
- None of lexical’s dependencies will conflict with your project. This means that lexical can make use of dependencies to make developing in it easier without having to “vendor” them. It also means that you can use lexical to work on your project, even if lexical depends on your project.
- Your project can depend on a different version of elixir and erlang than lexical itself. This means that lexical can make use of the latest versions of elixir and erlang while still supporting projects that run on older versions.
- The build environment for your project is only aware of your project, which enables as-you-type compilation and error reporting.
- In the future, there is a possibility of having the lexical vm instance control multiple projects
Lexical 0.4.0 Has been released!
Get it here: Release v0.4.0 · lexical-lsp/lexical · GitHub
Github: GitHub - lexical-lsp/lexical: Lexical is a next-generation elixir language server · GitHub
The main thrust of v0.4 is hover support and quality of life improvements. Now, when you hover over a module or function, you’ll see relevant documentation, types and parameters. We’ve also spent a lot of time working on completions in #410, which makes them more consistent, fixes some bugs in certain language clients (like eglot adding an extra @ when completing module attributes), and greatly improves their feel in vscode.
Additionally, quite a few of the changes in this PR were about laying the groundwork for our indexing infrastructure, which will debut in the next version. But fear not, this version has indexing disabled.
I want to thank @zachallaun and @scottming for all their hard work on this release. They’ve made lexical faster, more friendly and have removed a bunch of bugs!
Highlights include:
- Document hover for functions and modules
- Improved boot scripts
- Automatically updating nix flake. Thanks, @hauleth
- Helix editor integration. Thanks @philipgiuliani
- .heex integration
- Massively improved completions (Check out the PR, it’s too big to summarize)
Bugs fixed:
- Longstanding unicode completion / editing bugs slain. Unicode works perfectly now.
Most Liked
scohen
Lexical 0.5 Has been released
This release includes a ton of bugfixes and feature improvements, and debuts our search and indexing framework, which powers find references and go to definition, and will power a host of other features.
Highlights include:
- Support for elixir version 1.16
- Handled renaming of
rtxtomise - Multiple improvements to the hover popup
- Improved ease of writing new code actions
- Undefined variables diagnostics error for HEEx templates
- Code action: Suggested function names
- Completions for typespecs
- Improved nix flake
scohen
Lexical 0.6 has been released
We have document symbols and workspace symbols now, both powered by our indexing infrastructure. In addition, we’ve refined our indexer to be faster, more accurate and more stable than before.
Give it a shot, we’re pretty happy with the results.
scohen
Lexical 0.7 Has been released!
We’re releasing 0.7 so we can support Elixir 1.17 and Erlang 27. However, those users on Erlang 27 will experience large increases in the amount of memory Lexical takes up due to this bug. When that bug is fixed, we’ll push out another release that will detect the newer version of Erlang and things should go back to normal.
There are a lot more features and bugfixes too, like “Add Alias” and “Organize Aliases” code actions. Check out the full release notes here
Popular in Announcing
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #javascript
- #code-sync
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








