From c52079191fc23129ef396d09e13618b85f249c6e Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Thu, 21 Dec 2023 03:24:08 -0600 Subject: [PATCH] els_typer: Handle OTP26 changes to dialyzer functions (#1444) --- apps/els_lsp/src/els_typer.erl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/els_lsp/src/els_typer.erl b/apps/els_lsp/src/els_typer.erl index aa1861210..b5b37e0ce 100644 --- a/apps/els_lsp/src/els_typer.erl +++ b/apps/els_lsp/src/els_typer.erl @@ -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(). @@ -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