-
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
Crash: protocol Jason.Encoder not implemented for ElixirLS.LanguageServer.Protocol.DocumentSymbol #253
Comments
I'm seeing an identical failure with the 0.4.0 release. I've not had a chance to do a git bisect yet, but will try this evening if I have some time. :-) |
Does this only affect Elixir |
Based on my testing Elixir But I've been |
Can confirm that elixir 1.10.3 with OTP 22 is working fine. :-) |
Let's focus on the error. The I think this might be a conflict with the I added a second log which includes the Mix project compilation with warnings. It includes fragments from several runs so I'm not sure of exact reproduction steps. Highlights1.
2. ElixirLS Dialyzer fails with duplicate protocol modules found between my
3. ElixirLS crashes with
This hints that the (consolidated?) protocol implementation from the extension is not being found. Docs state protocols are consolidated in the I've been using the VSCode BEAMdasm extension to examine which |
Thanks for the research, I'm pretty sure that you are correct that this error is related to protocol consolidation with multiple versions of Jason clobbering each other. I think the most straightforward fix for right now would be to vendor Jason. |
@thetamind can you try out #258 and see if that fixes the issue for you? |
* Vendor Jason library Vendor the Jason library so that the version of Jason used by ElixirLS does not conflict with the version used by the end-users code. Right now one will win out over the other which can lead to issues. Luckily since Jason has been pretty stable there haven't been too many issues up to this point. Fixes #253 * remove jason from mix.lock
(Protocol.UndefinedError) protocol Jason.Encoder not implemented for %ElixirLS.LanguageServer.Protocol.DocumentSymbol
Environment
macOS High Sierra 10.13.6
VSCode 1.44.2
jakebecker.elixir-ls v0.4.0
Troubleshooting
.elixir_ls
directory, then restart your editorReproduction steps
I could not trigger the error with a simple file in a empty mix project, but I could in a new Phoenix project.
mix phx.new hello # Phoenix 1.5.1
cd hello
code .
lib/hello/repo.ex
defmodule Hello.Repo do
press enter to insert new lineElixirLS has crashed. See Output panel.
Logs
Full log.
The text was updated successfully, but these errors were encountered: