Can't make dialyzer works on Emacs + LSP setup

squiter
Mon, 20 May 2024 14:31:31 +0000
Questions / Help

Hey folks, I can’t manage to make my Emacs + LSP setup to work… something is odd…

I’m using:
elixir 1.16.2-otp-25
erlang 25.3
Emacs 29.3

I’m using asdf to install elixir and erlang.

My lsp config:

(use-package lsp-mode
  :hook ((elixir-mode . lsp))
  :commands lsp
  :init
  (add-to-list 'exec-path *elixir-ls-path*))

I added that add-to-list to make some tests, because I saw that in some issues, but it seems it didn’t change anything… I was getting the same error before adding it…

And I’m getting this error in the lsp-log buffer:

11:16:20.484 [error] Task #PID<0.334.0> started from #PID<0.333.0> terminating
** (UndefinedFunctionError) function :dialyzer_options.build/1 is undefined (module :dialyzer_options is not available)
    :dialyzer_options.build([report_mode: :quiet, erlang_mode: true, analysis_type: :plt_build, files: [~c"**home-dir**/.asdf/installs/erlang/25.3/lib/kernel-8.5.4/ebin/auth.beam", ~c"**home-dir**/.asdf/installs/elixir/1.16.2-otp-25/bin/../lib/elixir/ebin/Elixir.Inspect.URI.beam", ~c"**home-dir**/.asdf/installs/erlang/25.3/lib/stdlib-4.3/ebin/zip.beam", ~c"**home-dir**/.asdf/installs/elixir/1.16.2-otp-25/bin/../lib/elixir/ebin/Elixir.String.Chars.Integer.beam", ~c"**home-dir**/.asdf/installs/elixir/1.16.2-otp-25/bin/../lib/mix/ebin/Elixir.Mix.Tasks.Archive.beam", ~c"**home-dir**/.asdf/installs/elixir/1.16.2-otp-25/bin/../lib/elixir/ebin/Elixir.Module.Types.Helpers.beam", ~c"**home-dir**/.asdf/installs/elixir/1.16.2-otp-25/bin/../lib/elixir/ebin/Elixir.Module.Types.Pattern.beam", ~c"**home-dir**/.asdf/installs/erlang/25.3/lib/compiler-8.2.4/ebin/beam_trim.beam", ~c"**home-dir**/.asdf/installs/elixir/1.16.2-otp-25/bin/../lib/elixir/ebin/Elixir.Inspect.Tuple.beam", ~c"**home-dir**/.asdf/installs/erlang/25.3/lib/compiler-8.2.4/ebin/beam_ssa_opt.beam", ~c"**home-dir**/.asdf/installs/elixir/1.16.2-otp-25/bin/../lib/iex/ebin/Elixir.IEx.Info.Any.beam", ~c"**home-dir**/.asdf/installs/erlang/25.3/lib/stdlib-4.3/ebin/otp_internal.beam", ~c"**home-dir**/.asdf/installs/elixir/1.16.2-otp-25/bin/../lib/mix/ebin/Elixir.Mix.Tasks.Local.beam", ~c"**home-dir**/.asdf/installs/erlang/25.3/lib/kernel-8.5.4/ebin/application.beam", ~c"**home-dir**/.asdf/installs/erlang/25.3/lib/kernel-8.5.4/ebin/inet_dns.beam", ~c"**home-dir**/.asdf/installs/elixir/1.16.2-otp-25/bin/../lib/elixir/ebin/Elixir.File.RenameError.beam", ~c"**home-dir**/.asdf/installs/erlang/25.3/lib/compiler-8.2.4/ebin/core_lib.beam", ~c"**home-dir**/.asdf/installs/erlang/25.3/lib/kernel-8.5.4/ebin/inet6_udp.beam", ~c"**home-dir**/.asdf/installs/elixir/1.16.2-otp-25/bin/../lib/mix/ebin/Elixir.Mix.Error.beam", ~c"**home-dir**/.asdf/installs/elixir/1.16.2-otp-25/bin/../lib/elixir/ebin/Elixir.IO.ANSI.Docs.beam", ~c"**home-dir**/.asdf/installs/erlang/25.3/lib/stdlib-4.3/ebin/unicode_util.beam", ~c"**home-dir**/.asdf/installs/erlang/25.3/lib/kernel-8.5.4/ebin/os.beam", ~c"**home-dir**/.asdf/installs/elixir/1.16.2-otp-25/bin/../lib/elixir/ebin/Elixir.Collectable.beam", ~c"**home-dir**/.asdf/installs/elixir/1.16.2-otp-25/bin/../lib/mix/ebin/Elixir.Mix.Project.beam", ~c"**home-dir**/.asdf/installs/erlang/25.3/lib/stdlib-4.3/ebin/erl_abstract_code.beam", ~c"**home-dir**/.asdf/installs/elixir/1.16.2-otp-25/bin/../lib/elixir/ebin/elixir_erl_compiler.beam", ~c"**home-dir**/.asdf/installs/elixir/1.16.2-otp-25/bin/../lib/elixir/ebin/elixir_locals.beam", ~c"**home-dir**/.asdf/installs/elixir/1.16.2-otp-25/bin/../lib/iex/ebin/Elixir.IEx.Info.BitString.beam", ~c"**home-dir**/.asdf/installs/elixir/1.16.2-otp-25/bin/../lib/elixir/ebin/Elixir.Kernel.Typespec.beam", ~c"**home-dir**/.asdf/installs/erlang/25.3/lib/kernel-8.5.4/ebin/inet_hosts.beam", ~c"**home-dir**/.asdf/installs/erlang/25.3/lib/kernel-8.5.4/ebin/inet_config.beam", ~c"**home-dir**/.asdf/installs/elixir/1.16.2-otp-25/bin/../lib/iex/ebin/Elixir.IEx.Info.Time.beam", ~c"**home-dir**/.asdf/installs/elixir/1.16.2-otp-25/bin/../lib/elixir/ebin/Elixir.Date.beam", ~c"**home-dir**/.asdf/installs/elixir/1.16.2-otp-25/bin/../lib/mix/ebin/Elixir.Mix.Tasks.Deps.Precompile.beam", ~c"**home-dir**/.asdf/installs/elixir/1.16.2-otp-25/bin/../lib/elixir/ebin/Elixir.Enumerable.Date.Range.beam", ~c"**home-dir**/.asdf/installs/elixir/1.16.2-otp-25/bin/../lib/elixir/ebin/Elixir.IO.ANSI.beam", ~c"**home-dir**/.asdf/installs/erlang/25.3/lib/compiler-8.2.4/ebin/cerl_inline.beam", ~c"**home-dir**/.asdf/installs/elixir/1.16.2-otp-25/bin/../lib/elixir/ebin/elixir_dispatch.beam", ~c"**home-dir**/.asdf/installs/erlang/25.3/lib/kernel-8.5.4/ebin/file.beam", ~c"**home-dir**/.asdf/installs/erlang/25.3/lib/stdlib-4.3/ebin/array.beam", ~c"**home-dir**/.asdf/installs/erlang/25.3/lib/kernel-8.5.4/ebin/erl_erts_errors.beam", ~c"**home-dir**/.asdf/installs/erlang/25.3/lib/stdlib-4.3/ebin/filelib.beam", ~c"**home-dir**/.asdf/installs/elixir/1.16.2-otp-25/bin/../lib/logger/ebin/Elixir.Logger.Backends.Console.beam", ~c"**home-dir**/.asdf/installs/elixir/1.16.2-otp-25/bin/../lib/iex/ebin/Elixir.IEx.Info.Port.beam", ~c"**home-dir**/.asdf/installs/erlang/25.3/lib/compiler-8.2.4/ebin/beam_ssa_share.beam", ~c"**home-dir**/.asdf/installs/erlang/25.3/lib/kernel-8.5.4/ebin/seq_trace.beam", ...], from: :byte_code, output_plt: ~c"**home-dir**/.asdf/installs/elixir/1.16.2-otp-25/.mix/elixir-ls-25.3_elixir-1.16.2"])
    dialyzer.erl:156: :dialyzer.run/1
    (language_server 0.8.2) lib/language_server/dialyzer/manifest.ex:146: ElixirLS.LanguageServer.Dialyzer.Manifest.build_elixir_plt/0
    (language_server 0.8.2) lib/language_server/dialyzer/manifest.ex:14: anonymous fn/1 in ElixirLS.LanguageServer.Dialyzer.Manifest.build_new_manifest/0
    (elixir 1.16.2) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
Function: #Function<2.124754306/0 in ElixirLS.LanguageServer.Dialyzer.Manifest.build_new_manifest/0>
    Args: []

8 posts - 3 participants