scohen

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

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 rtx to mise
  • 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

See the full release notes here

scohen

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.

Full release notes here

scohen

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

Where Next?

Popular in Announcing Top

Qqwy
Today I realized that it would be possible to implement currying-capability in Elixir, using some clever anonymous function creation. (‘c...
New
Crowdhailer
The latest release of Ace (0.10.0) includes serving content over HTTP/2. I have started writing a webserver to teach my self more about...
New
Crowdhailer
Experimenting with this code. OK.try do user <- fetch_user(1) cart <- fetch_cart(1) order = checkout(cart, user) save_orde...
New
jakub-zawislak
Hi everyone, I’m coming from the Symfony (PHP) framework. I like Phoenix, but it has a one thing that was build much better in the Symfo...
New
mbuhot
Leverage Open Api 3.0 (Swagger) to document, test, validate and explore your Plug and Phoenix APIs. Generate and serve a JSON Open API ...
New
josevalim
Hi everyone, We would like to announce that Plataformatec is working on a new MySQL driver called MyXQL. Our goal is to eventually integ...
New
tmbb
I’ve been working on two packages (not on hex.pm yet) to build admin interfaces for phoenix apps: bureaucrat - which contains a bunch ...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 42920 311
New
RobertDober
Earmark is a pure-Elixir Markdown converter. It is intended to be used as a library (just call Earmark.as_html), but can also be used as...
239 12560 134
New
ityonemo
Currently just starting out on a new mini-project - getting zig NIFs to run in elixir. https://github.com/ityonemo/zigler The idea here...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 126479 1222
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New

We're in Beta

About us Mission Statement