ElixirLS - the Elixir Language Server

The project I work on, compiling it on a M3 mac pro takes about 10-15 minutes with lexical, as some files are really huge. As for looking at logs, I was doing that before I switched to lexical and there was no explicit error, I have a feeling there might be some race condition there.

1 Like

Version 0.23.0 has been released :rocket:

Highlights:

  • Support for attaching to remote nodes in debug adapter
  • Fix for breaking change introduced in VSCode 1.92.0 related to CVE-2024-27980. This braking change was preventing the extension from starting on Windows

See full release notes

ElixirLS elixir-ls/CHANGELOG.md at v0.23.0 · elixir-lsp/elixir-ls · GitHub
vscode extension vscode-elixir-ls/CHANGELOG.md at v0.23.0 · elixir-lsp/vscode-elixir-ls · GitHub

5 Likes

Version 0.24.0 has been released :rocket:

Highlights:

  • Local file code intelligence engine provided by elixir_sense library has been rewritten from scratch using new elixir 1.17 Macro.Env APIs. The new APIs has been backported to earlier elixir versions 1.13 - 1.16. The new engine expands and traverses elixir AST in a way that mirrors the elixir compiler behavior. As a result, ElixirLS is able to more accurately infer aliases/imports/requires, track variable/attribute definitions and usage, track calls, defined functions, modules and typespecs. It is now also able to expand some macros. All that information is used for completions, navigation to definition, finding references and other LSP operations requiring understanding of elixir code.
    Limitations: The new engine does not expand local macros, and support for dynamically defined functions, modules, and typespecs (including those with unquote fragments) is partial.

See full release notes

ElixirLS elixir-ls/CHANGELOG.md at v0.24.0 · elixir-lsp/elixir-ls · GitHub
vscode extension vscode-elixir-ls/CHANGELOG.md at v0.24.0 · elixir-lsp/vscode-elixir-ls · GitHub

This may be one of the last major releases. I plan to maintain ElixirLS until Expert reaches feature parity.

13 Likes

I’m not sure if this is the right place to ask, but sometime a few months ago, ElixirLS (or maybe the VS Code extension) stopped showing function arguments when searching symbols or the showing the outline. This makes these features nearly useless imo since it’s so common to have many different function heads in Elixir. Is there anyway to get the old functionality back?

Also https://github.com/elixir-lang/expert is a broken link. What’s the link supposed to be? I’m curious and searching “Elixir expert” doesn’t really work.

Thanks!

1 Like

Awesome that there will be a single Language Server Protocol project moving forward :slight_smile:

ElixirLS (or maybe the VS Code extension) stopped showing function arguments when searching symbols

This change was intentional. The stringified arguments generated too much noise with more complex patterns. The idea was to make document symbols as close as possible to workspace symbols. I also surveyed other language servers and the conclusion was no other LSP did that (IIRC typescript LSP outputs arguments as child symbols but that’s too much noise as well).

Also https://github.com/elixir-lang/expert is a broken link

Public now The repo is private until it’s ready

Expert on github is 404 for me :frowning:

1 Like

Same here

Sorry for confusion, the Expert repo is private for now

Version 0.25.0 has been released :rocket:

Highlights:

  • Definition, implementations and references providers now return ranges. This means that editors will highlight the symbols in code and in case of VSCode finding references will work when the cursor is inside a definition
  • Complete provider will now return record fields when the cursor is inside a record macro call (currently only for locally defined records)
  • Completions provider will now emit keyword list options for defs with typespec including all the options

See full release notes

ElixirLS elixir-ls/CHANGELOG.md at v0.25.0 · elixir-lsp/elixir-ls · GitHub
vscode extension vscode-elixir-ls/CHANGELOG.md at v0.25.0 · elixir-lsp/vscode-elixir-ls · GitHub

16 Likes

do we have

refactoring in elixir ls? for cross file name changing?

check out RefactorEx - Effortless Elixir Refactoring in VS Code ⚙️

1 Like

Version 0.26.0 has been released :rocket:

Highlights:

  • Elixir 1.18 support

See full release notes

ElixirLS elixir-ls/CHANGELOG.md at v0.26.0 · elixir-lsp/elixir-ls · GitHub
vscode extension vscode-elixir-ls/CHANGELOG.md at v0.26.0 · elixir-lsp/vscode-elixir-ls · GitHub

7 Likes

I was just about to file a bug report that the formatter is not correctly invoked (there’s an error while doing so) but you just released 0.26.1 and fixed it. Nice.

1 Like

Why elixir-ls does not show definition or on ctl+click to elixir source code or the actual impl , since elixir is macros?
like impl of kernel functions and kernel special forms

1 Like

Afaik for elixir source files this is because we often install elixir precompiled, where the path of files on your machine won‘t match the path they were stored in when being compiled. Therefore the LS basically fails at finding the source files. If you install elixir from source compiling on your machine this should start working.

3 Likes

isnt asdf fetch from git and the install?

No, not by default: GitHub - asdf-vm/asdf-elixir: Elixir plugin for asdf version manager

To install from source see GitHub - asdf-vm/asdf-elixir: Elixir plugin for asdf version manager

1 Like
defmacro def(call, expr \\ nil) do
    define(:def, call, expr, __CALLER__)
  end

what does define do ?

Version 0.27.0 has been released :rocket:

Highlights:

  • Added Go to declaration provider. It can be used to navigate from implementation to callback definition in behaviour module, from protocol implementation to protocol definition or from overriding def to the __using__ macro.

  • Added support for asdf v0.16

See full release notes

ElixirLS elixir-ls/CHANGELOG.md at v0.27.0 · elixir-lsp/elixir-ls · GitHub
vscode extension vscode-elixir-ls/CHANGELOG.md at v0.27.0 · elixir-lsp/vscode-elixir-ls · GitHub

13 Likes