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

MethodError: no method matching Union{Int64, String}(::String) #836

Closed
pascal-mueller opened this issue Sep 15, 2020 · 6 comments
Closed

Comments

@pascal-mueller
Copy link

Hi,

trying to get this working this Coc neovim plugin. There were several issues regarding this problem but it never got solved.

Output channel: Julia Language Server Trace

ERROR:
[ Info: Indexing StaticLint...
MethodError: no method matching Union{Int64, String}(::String)
Stacktrace:

[1]
LanguageServer.InitializeParams
(
::
Dict{String,Any
}) at /home/user/.julia/packages/LanguageServer/y1ebo/src/protocol/initialize.jl:111
[2] dispatch_msg(::JSONRPC.JSONRPCEndpoint, ::JSONRPC.MsgDispatcher, ::Dict{String,Any}) at /home/user/.julia/packages/JSONRPC/1Kq3H/src/typed.jl:64
[3]
run(::LanguageServerInstance) at /home/user/.julia/packages/LanguageServer/y1ebo/src/languageserverinstance.jl:308
[4] top-level scope at none:1
[Info - 3:20:46 PM] Connection to server got closed. Server will restart.
[Error - 3:20:46 PM] /usr/bin/julia exited with code: 1

@davidanthoff davidanthoff added this to the Backlog milestone Sep 16, 2020
@martenlienen
Copy link

I have the same issue when I precompile LanguageServer with PackageCompiler. It works fine with the default sysimage.

@oblitum
Copy link

oblitum commented May 9, 2021

I'm also trying to use it from coc but have hit the same issue. What does a default sysimage mean?

This is my language server configuration that borrows from docs:

  if executable('julia')
    let languageservers['julia'] = {
    \   'command': 'julia',
    \   'args': ['--startup-file=no', '--history-file=no', '-e', '
    \     using LanguageServer;
    \     using Pkg;
    \     import StaticLint;
    \     import SymbolServer;
    \     env_path = dirname(Pkg.Types.Context().env.project_file);
    \     server = LanguageServer.LanguageServerInstance(stdin, stdout, env_path, "");
    \     server.runlinter = true;
    \     run(server);
    \   '],
    \   'filetypes': ['julia']
    \ }
  endif

Which means at first I'm not using coc-julia, just configuring the server directly. On julia REPL I Pkg.add LanguageServer, StaticLint and SymbolServer.

@martenlienen
Copy link

I had a custom sysimage compiled with PackageCompiler.jl, though since Julia 1.6 that is no longer necessary for good performance.

@oblitum
Copy link

oblitum commented May 9, 2021

I managed to fix this problem by picking LanguageServer from master:

julia> using Pkg
julia> Pkg.add(url="https://github.com/julia-vscode/LanguageServer.jl")
julia> Pkg.add("SymbolServer")
julia> Pkg.add("StaticLint")

@lassepe
Copy link

lassepe commented May 11, 2021

It seems that the root of this issue is that the tests fail on 3.2.0. If I run ]test LanguageServer in a clean environment with the lastest tagged version (LanaguageServer 3.2.0) then a lot of the tests error. coc-julia uses LanguageServer.jl:test/runtest.jl to generate precompile instructions.

@oblitum
Copy link

oblitum commented May 11, 2021

coc-julia is now fixed and avoids the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants