Skip to content

Commit

Permalink
els_typer: Handle OTP26 changes to dialyzer functions (#1444)
Browse files Browse the repository at this point in the history
  • Loading branch information
the-mikedavis authored Dec 21, 2023
1 parent 45dbe5e commit c520791
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions apps/els_lsp/src/els_typer.erl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@

-include("els_lsp.hrl").

-if(?OTP_RELEASE >= 26).
-define(DEFAULT_PLT_FILE, dialyzer_iplt:get_default_iplt_filename()).
-define(PLT_FROM_FILE(PltFile), dialyzer_iplt:from_file(PltFile)).
-else.
-define(DEFAULT_PLT_FILE, dialyzer_plt:get_default_plt()).
-define(PLT_FROM_FILE(PltFile), dialyzer_plt:from_file(PltFile)).
-endif.

-type files() :: [file:filename()].
-type callgraph() :: dialyzer_callgraph:callgraph().
-type codeserver() :: dialyzer_codeserver:codeserver().
Expand Down Expand Up @@ -427,11 +435,11 @@ get_dialyzer_plt() ->
PltFile =
case els_config:get(plt_path) of
undefined ->
dialyzer_plt:get_default_plt();
?DEFAULT_PLT_FILE;
PltPath ->
PltPath
end,
dialyzer_plt:from_file(PltFile).
?PLT_FROM_FILE(PltFile).

%% Exported Types

Expand Down

0 comments on commit c520791

Please sign in to comment.