Skip to content

Commit

Permalink
Revert "Precompute list of enabled diagnostics" (erlang-ls#1197)
Browse files Browse the repository at this point in the history
This reverts commit 2f6decd.

This change introduced a regression in the debugger, preventing it from starting.
The `els_dap` escript invokes the `els_config` initialization procedure
(see erlang-ls@4b475b0),
but the new version of the initialization depends on the `els_diagnostics` module,
which is part of the `els_lsp` application, not included in the `els_dap` escript.

For now simply reverting the change, but we should revisit the application structure.
The original idea was for an application to contain the implementation of the JSON-RPC protocol
and for the `els_dap` and `els_lsp` to utilize that as a dependency. That never really happened
and the current application split in Erlang LS in its current form feels a bit arbitrary.
One may argue that Erlang LS could get rid of the umbrella structure and be a single application.
  • Loading branch information
robertoaloi committed Feb 14, 2022
1 parent dcbeecb commit c371027
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion apps/els_core/src/els_config.erl
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ do_initialize(RootUri, Capabilities, InitOptions, {ConfigPath, Config}) ->
ok = set(otp_paths , otp_paths(OtpPath, false) -- ExcludePaths),
ok = set(lenses , Lenses),
ok = set(diagnostics , Diagnostics),
ok = set(enabled_diagnostics, els_diagnostics:enabled_diagnostics()),
%% All (including subdirs) paths used to search files with file:path_open/3
ok = set( search_paths
, lists:append([ project_paths(RootPath, AppsDirs, true)
Expand Down
2 changes: 1 addition & 1 deletion apps/els_lsp/src/els_diagnostics.erl
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ make_diagnostic(Range, Message, Severity, Source) ->

-spec run_diagnostics(uri()) -> [pid()].
run_diagnostics(Uri) ->
[run_diagnostic(Uri, Id) || Id <- els_config:get(enabled_diagnostics)].
[run_diagnostic(Uri, Id) || Id <- enabled_diagnostics()].

%%==============================================================================
%% Internal Functions
Expand Down

0 comments on commit c371027

Please sign in to comment.