-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ElixirLS crashes due to "no function clause matching in ElixirLS.LanguageServer.Diagnostics.range/2" #707
Comments
Can you post a project that reproduces this error? |
I tried to create a minimal project that reproduces the error. But I can't reproduce it. :/ How can I try to find out why/who created the diagnostics with a negative position? Is there some option to enable tracing? |
I have the same issue since yesterday on an unsharable project - it is an older style Elixir Umbrella app. Is there any info we can provide to help? BTW This project is awesome :D |
Could it be a version mismatch issue between ElixirLS and the project?
Erlang 22 vs 23 and 24 for the topic starter. Btw, my diagnostic range is nil:
|
You can build elixirLS from source and inspect the diagnostics returned by dialyzer in
My suspicion is one of them is returning invalid data (both should never return negative values) The other possible source of this error is
|
Thanks @lukaszsamson . Awesome work 👍 |
Environment
v0.10.0, ElixirLS compiled with Elixir 1.10.4 and erlang 22
Ubuntu 20.04.3 LTS (Focal Fossa)
VSCode
ElixirLS: Elixir support and debugger v0.10.0
Current behavior
ElixirLS crashes after(/during?) the Analyzing modules step.
Expected behavior
ElixirLS Dialyzer (? not sure who exactly) should not generate diagnostic output with a negative position and thus not crash the GenServer.
Here the spec says that the position should be always positive. However, the docs at the same time contradict this by saying that
0
represents unknown. That's also what's been implemented: the code for ElixirLS.LanguageServer.Diagnostics.range/2 deals with0
as a special case, i.e., it can handle any non-negative integer positions.The text was updated successfully, but these errors were encountered: