Skip to content

Conversation

@norbu09
Copy link

@norbu09 norbu09 commented Nov 25, 2025

Summary

Migrate Elixir language server support from NextLS to Expert, the official Elixir Language Server from elixir-lang.

Changes

  • Replace NextLS with Expert as the Elixir language server
  • Update download URLs to use Expert nightly releases from elixir-lang/expert
  • Update initialization params and capabilities for Expert compatibility
  • Add proper readiness detection for Expert's build/compilation cycle
  • Use absolute paths for file URIs (required by Expert)
  • Update test fixtures for better performance with session-scoped fixtures
  • Mark tests affected by Expert 0.1.0 bugs as xfail

Why Expert?

  • Expert is the official language server from the Elixir core team
  • NextLS development has been discontinued in favor of Expert
  • Expert provides better integration with the Elixir ecosystem

Testing

  • All existing Elixir tests pass (18 passed, 3 skipped, 3-4 xfailed due to Expert bugs)
  • Tests can be run quickly with `-m "not slow"` (~30s vs ~3+ minutes for full suite)
  • Expert bugs are upstream issues, not integration problems

Notes

  • Expert 0.1.0 (nightly) has some known bugs with `textDocument/definition` and `textDocument/documentSymbol` for certain files
  • These are tracked as xfail tests and will pass once Expert fixes them
  • First startup can take 2-3+ minutes while Expert compiles and indexes the project

# Conflicts:
#	src/solidlsp/language_servers/elixir_tools/elixir_tools.py
@kuskhan
Copy link

kuskhan commented Nov 29, 2025

I hope this gets merged soon. Currently, NextLS is throwing errors continuously and appears to be unusable. Although the expert is not yet officially announced as stable version, I believe it is practically quite reliable for use. It is actually very stable in my Zed editor. Furthermore, expert is the official LSP of the Elixir community.

@MischaPanch
Copy link
Contributor

Hi @norbu09 , thanks for the contribution. For some reason our tests hang on Ubuntu in CI, but on MacOS they should run through (they do so on main). It seems like the elixir tests are hanging now, maybe due to some setup issue. Could you pls make sure the tests run through in CI on macOS? Then I can review this in more detail

The quotes around the expert executable path were causing issues
with the command execution. This aligns with how other language
servers (gopls, bash-language-server, etc.) construct their commands.
Expert's _get_initialize_params now converts relative paths to absolute
before creating file URIs, fixing ValueError when pathlib.Path.as_uri()
is called on relative paths.

Note: Expert 0.1.0 still has issues responding to LSP document_symbol
requests, causing tests to hang. This appears to be a limitation of the
current alpha release of Expert rather than our integration code.
- Ensure repository_root_path is always absolute in SolidLanguageServer.create()
- Detect Expert readiness when 'Building {project}' progress ends
- Track building state to properly identify project build completion
- Fix string formatting in log messages

This fixes the Expert language server integration to properly:
1. Use absolute paths for file URIs (required by LSP)
2. Detect when Expert finishes compiling the project
3. Proceed with requests immediately after build completes
- Use session-scoped fixtures for tests with custom ignored paths
- Mark tests requiring separate Expert instances as @pytest.mark.slow
- Add xfail markers for tests affected by Expert 0.1.0 bugs
- Register 'slow' pytest marker in pyproject.toml

Tests can now be run quickly with '-m "not slow"' to skip tests
that require additional Expert instances (~60-90s startup each).

Full test suite: ~3+ minutes (3 Expert instances)
Fast tests only: ~30s (1 Expert instance)
- Remove verbose progress logging, keep only essential messages
- Simplify readiness detection logic
- Keep error/warning messages from Expert visible
- Skip tests that require multiple Expert instances in CI (too slow)
- Add xfail marker to test_symbol_tree_excludes_build_dirs (Expert bug)
- Expert 0.1.0 has flaky document_symbols that sometimes returns nil
@norbu09
Copy link
Author

norbu09 commented Dec 2, 2025

@MischaPanch i got a few updates and the tests run locally. not sure if the CI is happy now as i think it is skipped for some reason. i am so not a python dev, sorry for my lack of understanding how all this is set up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants