Skip to content

Add Expert LSP support for Elixir#9398

Open
manusajith wants to merge 3 commits intowarpdotdev:masterfrom
manusajith:manu/add-expert-elixir-lsp
Open

Add Expert LSP support for Elixir#9398
manusajith wants to merge 3 commits intowarpdotdev:masterfrom
manusajith:manu/add-expert-elixir-lsp

Conversation

@manusajith
Copy link
Copy Markdown

Description

Wire up Expert as a built-in LSP server for Warp's editor.

For now, Warp only uses Expert when start_expert is already available on PATH. It does not auto-install Expert or bundle a runtime.

Expert is becoming the main Elixir language server under the EEF, so this was preferred over ElixirLS.

This adds:

  • Elixir language detection for .ex, .exs, .eex, .heex, .leex, .neex, plus mix.exs, mix.lock, and .formatter.exs
  • LSPServerType::Expert, which runs start_expert --stdio
  • Workspace detection through mix.exs, mix.lock, or .formatter.exs
  • An install message that points users to the Expert releases page

Tree-sitter highlighting is already covered by arborium's lang-elixir feature, so there are no crate or language wiring changes needed.

Testing

  • New unit tests in crates/lsp/src/config_tests.rs covering:
    • Extension detection: .ex, .exs, .eex, .heex, .leex, .neex
  • cargo test -p lsp, cargo fmt -- --check

Server API dependencies

N/A

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

Changelog Entries for Stable

CHANGELOG-IMPROVEMENT: Added built-in support for the Expert language server for Elixir in the editor (install via the Expert releases page so that start_expert is on your PATH).

Wire up Expert as a built-in LSP server for Warp's editor.

For now, Warp only uses Expert when `start_expert` is already
available on `PATH`. It does not auto-install Expert or bundle
a runtime.

Expert is becoming the main Elixir language server under the
EEF, so this was preferred over ElixirLS.

This adds:

* Elixir language detection for `.ex`, `.exs`, `.eex`, `.heex`, `.leex`, `.neex`, plus `mix.exs`, `mix.lock`, and `.formatter.exs`
* `LSPServerType::Expert`, which runs `start_expert --stdio`
* Workspace detection through `mix.exs`, `mix.lock`, or `.formatter.exs`
* An install message that points users to the Expert releases page

Tree-sitter highlighting is already covered by arborium' `lang-elixir` feature, 
so there are no crate or language wiring changes needed.
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Apr 29, 2026

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @manusajith on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment @cla-bot check to trigger another check.

@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented Apr 29, 2026

@manusajith

I'm starting a first review of this pull request.

I requested changes on this pull request and posted feedback.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

I'm re-reviewing this pull request in response to a review request.

You can view the conversation on Warp.

I requested changes on this pull request and posted feedback.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@manusajith
Copy link
Copy Markdown
Author

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed label Apr 29, 2026
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Apr 29, 2026

The cla-bot has been summoned, and re-checked this pull request!

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR adds Elixir language detection and wires the new Expert LSP server type through the LSP server registry.

Concerns

  • Expert is suggested for Mix repos even when start_expert is not installed, but this PR does not provide an auto-install implementation. Existing setup/settings flows treat that state as installable and will route users to an install action that always fails.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread crates/lsp/src/servers/expert.rs Outdated
Only suggest Expert when start_expert is already on PATH.
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented Apr 29, 2026

@manusajith

I'm checking this implementation PR for association with a likely matching ready issue.

Powered by Oz

@manusajith
Copy link
Copy Markdown
Author

/oz-review

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR adds Elixir/Expert language detection, server configuration, and candidate wiring for Warp's LSP support.

Concerns

  • Expert is configured to find and launch only start_expert, but the public releases linked by the install guidance provide the released executable (expert or platform-specific expert_*) rather than start_expert, so users following the documented install path will not be detected or started.
  • Template extensions are mapped to the same LanguageId::Elixir value, which means Warp sends elixir as the LSP languageId for EEx/HEEx-style buffers instead of template-specific identifiers.
  • Supplemental security pass: no security-specific issues found in the changed lines.

Verdict

Found: 0 critical, 2 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread crates/lsp/src/supported_servers.rs Outdated
LSPServerType::Pyright => "pyright-langserver",
LSPServerType::TypeScriptLanguageServer => "typescript-language-server",
LSPServerType::Clangd => "clangd",
LSPServerType::Expert => "start_expert",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [IMPORTANT] The public Expert releases install a binary named expert or a platform-specific expert_*, while start_expert is only present in source-built plain releases. Since detection and spawning use binary_name(), users following the linked releases install path will be reported as not installed and unable to start Expert; support the release binary or both names before enabling this.

Comment thread crates/lsp/src/config.rs Outdated
// compile_commands.json is present, clangd will use the correct language
// regardless of the languageId we send.
"h" | "H" | "hh" | "hpp" | "hxx" => Some(Self::Cpp),
"ex" | "exs" | "eex" | "heex" | "leex" | "neex" => Some(Self::Elixir),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [IMPORTANT] Mapping .eex/.heex/.leex/.neex to LanguageId::Elixir makes didOpen send languageId elixir for template files. Expert/editor configs treat EEx/HEEx as distinct filetypes (eelixir/heex), so template buffers can be parsed as plain Elixir; add distinct language IDs or otherwise send the template-specific identifiers.

The Expert release binaries are named `expert_<platform>` (renamed
to `expert` on PATH); `start_expert` only exists in source-built
plain releases. Spawning and detection both go through binary_name,
so users following the documented install path were never matched.

Templates also need distinct LSP language IDs: EEx and HEEx are
treated as their own filetypes by Expert and other Elixir LSPs, so
sending `elixir` for `.eex` / `.heex` buffers means template syntax
is parsed as plain Elixir.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant