erlang-ls / erlang_ls

The Erlang Language Server
https://erlang-ls.github.io/
Apache License 2.0
620 stars 136 forks source link

Dialyzer issue on VS Code and Vim #1443

Closed mcesaro closed 6 months ago

mcesaro commented 11 months ago

Describe the bug The PLT-based erlang LS features are not available on VS Code and Vim editor

To Reproduce Just open any erlang OTP 26 project with a valid PLT file generated by dialyzer on VS Code and look at the Output tab.

Expected behavior Successful processing of the dialyzer PLT file and specification suggestions working.

Actual behavior No suggestions and any other feature related to dialyzer analysis. In the VS Code output tab we see this warning message:

Warn  - 2:46:29 PM] [2023-07-24T14:46:29.804060+02:00] [warning] Cannot extract typer info., Class: error, Exception: undef, Stacktrace: [{dialyzer_plt,from_file,["/home/max/work/test/_build/default/rebar3_26.0_plt"],[]},{els_typer,collect_info,1,[{file,"/home/runner/work/vscode/vscode/erlang_ls/apps/els_lsp/src/els_typer.erl"},{line,302}]},{els_typer,get_info,1,[{file,"/home/runner/work/vscode/vscode/erlang_ls/apps/els_lsp/src/els_typer.erl"},{line,83}]},{els_code_lens_suggest_spec,init,1,[{file,"/home/runner/work/vscode/vscode/erlang_ls/apps/els_lsp/src/els_code_lens_suggest_spec.erl"},{line,29}]},{els_code_lens,lenses,2,[{file,"/home/runner/work/vscode/vscode/erlang_ls/apps/els_lsp/src/els_code_lens.erl"},{line,91}]},{els_code_lens_provider,'-run_lenses_job/1-lc$^0/1-0-',3,[{file,"/home/runner/work/vscode/vscode/erlang_ls/apps/els_lsp/src/els_code_lens_provider.erl"},{line,37}]},{els_code_lens_provider,'-run_lenses_job/1-lc$^0/1-0-',3,[{file,"/home/runner/work/vscode/vscode/erlang_ls/apps/els_lsp/src/els_code_lens_provider.erl"},{line,38}]},{els_code_lens_provider,'-run_lenses_job/1-fun-1-',2,[{file,"/home/runner/work/vscode/vscode/erlang_ls/apps/els_lsp/src/els_code_lens_provider.erl"},{line,38}]}] [els_code_lens_suggest_spec:init/1 L39] <0.486.0>

The thing I cannot explain is that in the error description:

[warning] Cannot extract typer info., Class: error, Exception: undef, Stacktrace: [{dialyzer_plt,from_file,["/home/max/work/test/_build/default/rebar3_26.0_plt"],[]}

the reference to the undocumented dialyzer_plt:from_file() function is suspect, since I can't find it in the dialyzer source code in the erlang OTP repository.

Thanks

Context

mcesaro commented 11 months ago

Cool, thanks. Just an observation: before opening the issue I tried to replace dialyzer_plt:from_file() with dialyzer_iplt:from_file() , but then the call still failed complaining that the PLT file generated by rebar3 dialyzer is not incremental.