Skip to content
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

languageserver crashes because of MethodError: no method matching Union{Int64, String}(::String) #40

Closed
Gijs-Koot opened this issue Oct 21, 2020 · 5 comments

Comments

@Gijs-Koot
Copy link

When starting the LanguageServer with lsp, the LanguageServer starts but eventually crashes with the following error appearing in julia-ls:stderr;

[ Info: Received new data from Julia Symbol Server.
ERROR: MethodError: no method matching Union{Int64, String}(::String)
Stacktrace:
 [1] LanguageServer.InitializeParams(::Dict{String,Any}) at /home/gijs/.julia/packages/LanguageServer/y1ebo/src/protocol/initialize.jl:111
 [2] dispatch_msg(::JSONRPC.JSONRPCEndpoint, ::JSONRPC.MsgDispatcher, ::Dict{String,Any}) at /home/gijs/.julia/packages/JSONRPC/1Kq3H/src/typed.jl:64
 [3] run(::LanguageServerInstance) at /home/gijs/.julia/packages/LanguageServer/y1ebo/src/languageserverinstance.jl:308
 [4] top-level scope at none:1

This is an issue that was filed at julia-vscode/LanguageServer.jl as well, more details there julia-vscode/LanguageServer.jl#651.

If I understand correctly, a fix has been merged here julia-vscode/LanguageServer.jl#821, but this isn't present in the latest release.

If I install the master branch directly, with

(@v1.5) pkg> add https://github.com/julia-vscode/LanguageServer.jl

the server starts without this error and appears to work well. This will eventually be resolved by a new release of LanguageServer.jl, but I thought to file this anyway for anyone using lsp-julia.

@ki-chi
Copy link

ki-chi commented Oct 25, 2020

Do you use create_sysimage() in PackageCompiler.jl?

As the comment on the issue of julia-vscode/LanguageServer.jl#836, the error may be caused by precompiling LanguageServer with PackageCompiler.

Skipped the precompile, it works well on my environment. (LanguageServer v3.2.0 and Julia v1.5)

@Gijs-Koot
Copy link
Author

The command issued to julia by this package doesn't include it, and I didn't consciously precompile it no. Also, I don't have PackageCompiler installed, so it seems unlikely that I'm using an image somewhere. The bug above does appear to explain it, and I'm just using master until the fix is merged. Thanks.

@danmrc
Copy link

danmrc commented Mar 8, 2021

Did this changed? I have the same issue, and I have not used PackageCompiler.jl

I can't use the add https://github.com/julia-vscode/LanguageServer.jl because it conflicts with some packages

Thanks in advance

@roiholtzman
Copy link

roiholtzman commented Mar 22, 2021

I also have this issue.

@gdkrmr
Copy link
Owner

gdkrmr commented Mar 31, 2021

should be solved now

@gdkrmr gdkrmr closed this as completed Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants