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

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
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
Werner
Hi, I’m using Ubuntu 18.04 and after updating to OTP-24.0 yesterday i have this warning when I run “mix local.hex”: 14:57:30.512 [warn] ...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
mathew4509
I have a list say x = ["23gh", "56kh", "97mh"] I would like to pass each element to Val in each iteration. Say, in iteration 1 -------...
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 Postg...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New

Other popular topics Top

chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30048 115
New
yurko
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New

We're in Beta

About us Mission Statement