fix: make ErlangLanguageServer instantiable (implement _create_base_initialize_params) - #1794
Merged
Merged
Conversation
AmirF194
reviewed
Aug 1, 2026
AmirF194
left a comment
Contributor
There was a problem hiding this comment.
CONTRIBUTING.md asks for a CHANGELOG.md entry on every PR (under "Submitting Pull Requests"), and every recently merged PR here has one (#1779, #1763, #1759, #1758, #1754). This one doesn't yet; probably belongs under "Language Servers".
The fix itself checks out. _create_base_initialize_params matches the pattern ocaml_lsp_server.py and the other converted backends use, and SolidLanguageServer._create_initialize_params() (ls.py:3193) already supplies processId/rootUri/clientInfo/workspaceFolders through the builder, so dropping them from the literal here is correct rather than a behavior change.
Contributor
ErlangLanguageServer was left behind when the initialize-params refactor moved server-specific capabilities into _create_base_initialize_params. It still built its initialize dict inline in _start_server, so the class never satisfied the abstract method declared on SolidLanguageServer and could not be instantiated at all: Can't instantiate abstract class ErlangLanguageServer without an implementation for abstract method '_create_base_initialize_params' Move the capabilities block into the required method, following the pattern used by the other backends, and let _start_server build its params via _create_initialize_params(). processId/rootPath/rootUri are dropped from the literal since the builder supplies them.
opcode81
force-pushed
the
fix/erlang-initialize-params
branch
from
August 1, 2026 09:41
7970e11 to
c94d9c6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
ErlangLanguageServercannot be instantiated at all. Every Serena tool fails on an Erlang project during project initialisation:Because the failure is at initialisation, it takes down every tool, not just the one called —
get_symbols_overview,find_symbol,find_referencing_symbolsand the editing tools all fail identically.Cause
When server-specific initialize params were moved behind the abstract
_create_base_initialize_paramshook onSolidLanguageServer(ls.py), the Erlang backend was not converted with the others. It still builds its initialize dict inline inside_start_serverand passes it straight toself.server.send.initialize(...), so it never implements the abstract method and the class is left abstract.This is not environment-specific: it reproduces with
erlang_lscorrectly installed and onPATH, on currentmain.Fix
Convert the backend to the same pattern the other language servers use (compare
ocaml_lsp_server.py):capabilitiesblock out of_start_serverinto_create_base_initialize_params.processId/rootPath/rootUrifrom the literal —DefaultInitializeParamsBuildersupplies those, and the method's docstring explicitly says implementations should not set them._start_serverbuild its params viaself._create_initialize_params().pathlibimport.No behavioural change beyond making the class instantiable; the capabilities advertised to
erlang_lsare the same ones the inline dict sent. The# type: ignore[arg-type]on theinitializecall is no longer needed, since_create_initialize_params()returns a properly typedInitializeParams.Verification
Against a real rebar3 umbrella project (~12 OTP applications), with
erlang_lsonPATH:ErlangLanguageServer.__abstractmethods__is now empty — the class instantiates.get_symbols_overviewon a 700-line module returns its functions, records and macros.find_referencing_symbolson a record returns 26 cross-references with correct locations and snippets.Note on erlang_ls vs ELP
erlang_lswas archived on 2025-08-15, and #771 tracks moving to ELP; #1149 attempted that and was closed over a branch/CI problem rather than on the merits. This PR takes no position on that migration — it only makes the Erlang backend that currently ships actually usable. If ELP support lands later, this file is likely replaced wholesale, but until then the shipped backend is 100% non-functional and this is a small fix.