Skip to content

Commit

Permalink
Precompute list of enabled diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
robertoaloi committed Dec 24, 2021
1 parent 658e8ff commit 2f6decd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions apps/els_core/src/els_config.erl
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ 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 <- enabled_diagnostics()].
[run_diagnostic(Uri, Id) || Id <- els_config:get(enabled_diagnostics)].

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

0 comments on commit 2f6decd

Please sign in to comment.