squiter

squiter

Can't make dialyzer works on Emacs + LSP setup

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: []

Marked As Solved

cevado

cevado

last time I checked the lsp-mode package was using a version of the elixir-ls that had issues. you can set the elixir-ls version by overwriting lsp-elixir-ls-version.
I have something like on my config:

(setq lsp-elixir-ls-version "v0.20.0")

Also Liked

squiter

squiter

Interesting… the value was v0.20.0 and I changed to the last one v0.21.2 and then I run the lsp-install-server again, because it seems it didn’t work for the first time… and now, it’s working :slight_smile:

Thanks

Where Next?

Popular in Questions Top

chokchit
** (DBConnection.ConnectionError) connection not available and request was dropped from queue after 2733ms. You can configure how long re...
New
beno
I will often find my self writing things similar to: case some_value do nil -&gt; something() "" -&gt; something() _ -&gt; somethi...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

Other popular topics Top

Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New

We're in Beta

About us Mission Statement