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

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

scohen

scohen

Lexical 0.7.2 has been released

It includes fixes for some long-standing performance issues, and improved support for editing configuration files.

Lexical is now VERY snappy. Enjoy!

scohen

scohen

We’ve taken a different approach for things like find references that should yield an improvement over the strategy taken by elixir-ls, but it’s early days for the feature. We need to improve the performance of the indexer, but we have lots of options, and are optimistic.

To give you an idea, I have a test project that has around 800,000 lines of code, and find references takes 20 milliseconds.

Right now, the bottleneck is indexing, a project that size will take minutes to index, but we’re working on it. it really depends on how large the codebase is. Are we taking about millions of lines? Hundreds of thousands?

Where Next?

Popular in Libraries Top

scohen
Lexical Lexical is a next-generation language server for the Elixir programming language. Features Context aware code completion As-you...
New
tompave
Hello there, I would like to share a feature toggles library (AKA feature flags) I’ve been working on. The main package is FunWithFlags...
New
devonestes
Introducing assertions, the library that helps you write really great test assertions! GitHub: https://github.com/devonestes/assertions ...
New
sasajuric
I’d like to announce a small library called boundaries. This is an experimental project which explores the idea of enforcing boundaries ...
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
riverrun
I’ve just released version 3 of Comeonin, a password hashing library. The following small changes have been made: changes to the NIF c...
New
asiniy
Hey there! I wrote a download elixir package which does exactly what its name about - an easy way to download files. I saw solutions ...
New
woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
ahamez
Hi everyone, I’ve been working on this protobuf library for 3 years. We use it in the company I work for, EasyMile, to communicate with ...
New
New

Other popular topics Top

chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30048 115
New
yurko
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
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
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
273 38985 115
New
AstonJ
by Lance Halvorsen Elixir and Phoenix are generating tremendous excitement as an unbeatable platform for building modern web application...
460 27162 124
New

Sub Categories:

We're in Beta

About us Mission Statement