Lexical - A Language Server for Elixir

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

16 Likes

Any idea how (if it is even possible) to use the new document/workspace symbols functionality in Zed editor?

What I like the most regarding workspace symbols (using VScode here):
If you have function components within heex/~H sigil it is possible to position the cursor within the name:
Visual Studio Code - Insiders - Cursor

And after a Ctrl-T one might jump directly to the definition:
Visual Studio Code - Insiders - Workspace

Of course I would like to see better support for these kind of things. But right now it’s good enough for me

In most editors workspace symbols is exposed via some kind of “project search” and document symbols is exposed as a kind of “file hierarchy” panel. I don’t know about zed specifically though.

1 Like

OK, in Zed, it’s CMD+T (doh :man_facepalming:), but in my rather big umbrella project, when I am looking at LSP Logs (RPC Messages), I can see something like this:

// Send:
{"jsonrpc":"2.0","id":67,"method":"workspace/symbol","params":{"query":"repo"}}
// Send:
{"jsonrpc":"2.0","method":"$/cancelRequest","params":{"id":66}}
// Receive:
{"error":{"code":-32603,"message":"** (ErlangError) Erlang error: {:exception, %Protocol.UndefinedError{protocol: Enumerable, value: {:error, {:not_enabled, {:fuzzy, \"repo\", []}}}, description: \"\"}, [{Enumerable, :impl_for!, 1, [file: ~c\"lib/enum.ex\", line: 1]}, {Enumerable, :reduce, 3, [file: ~c\"lib/enum.ex\", line: 166]}, {Enum, :map, 2, [file: ~c\"lib/enum.ex\", line: 4399]}, {LXical.RemoteControl.CodeIntelligence.Symbols, :for_workspace, 1, []}]}\n    (kernel 9.2.1) erpc.erl:702: :erpc.call/5\n    (lx_server 0.5.0) lib/lexical/server/provider/handlers/workspace_symbol.ex:19: LXical.Server.Provider.Handlers.WorkspaceSymbol.handle/2\n    (lx_server 0.5.0) lib/lexical/server/provider/queue.ex:99: anonymous fn/2 in LXical.Server.Provider.Queue.State.as_task/2\n    (elixir 1.16.1) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2\n    (elixir 1.16.1) lib/task/supervised.ex:36: Task.Supervised.reply/4\n"},"id":67}

When I looked at the Lexical source, it seems that there is some indexing happening and until it’s finished, the fuzzy search is not enabled. Is it possible to show some UI alert that I have to wait until it’s done and ideally with current progress?

There should be progress indicated while indexing is running, are you not seeing it?

I started using Lexical again and I’m seeing progress percentages in my NeoVim status line.

This was basically the dimitarvp release :wink:

3 Likes

:flushed_face::scream::shushing_face::innocent:

To be fair, I was just the first one to raise the issue. :slight_smile:

well, now i’m using workspace symbols all the time.

It’s a better option than doing live grep. Not hugely better but reduces the signal-to-noise ratio enough for it to be perceptibly better.

(Also if you are going to flatter somebody, don’t misspell their name! :upside_down_face:)

I just started trying lexical but I wanted to say - thanks for having vim + ALE support! Was very easy to get it up and running

2 Likes

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

10 Likes

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!

8 Likes

Heya, I have been extremely busy in every area of life for like 6-7 months now and have stopped following but things are gradually calming down and I seriously want to start using Lexical full-time.

Was the workspace symbols feature added? I seem to recall you said it was? Furthermore, is Lexical working with Elixir 1.18 / Erlang 27.x?

2 Likes

Congratz with the release!

What a nice improvement it is!

But why Lexical wasn’t like this right from the start??
Just kidding :joy:

Thanks for all your work!

1 Like

OK, we’ll have to wait a little bit more for Elixir 1.18. Just tried Lexical and it said it’s not working with 1.18 yet.

It’s coming shortly, there’s already a pr out.

4 Likes