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

Language Server throwing MethodError #1003

Closed
jarbus opened this issue Nov 18, 2021 · 5 comments
Closed

Language Server throwing MethodError #1003

jarbus opened this issue Nov 18, 2021 · 5 comments

Comments

@jarbus
Copy link

jarbus commented Nov 18, 2021

Julia's Language Server has worked for me in the past, but is now throwing this error after a re-install and I can't figure out what's going on. Using the latest version and currently testing without an editor so I can catch debug info.

julia> using LanguageServer, LanguageServer.SymbolServer; runserver()
[ Info: Precompiling LanguageServer [2b0e0bc5-e4fd-59b4-8912-456d1b03d8d7]
ERROR: MethodError: no method matching (::LanguageServer.var"#93#95"{LanguageServerInstance})(::String, ::Int64)
Closest candidates are:
  (::LanguageServer.var"#93#95")(::Any) at /home/jack/.julia/packages/LanguageServer/JrIEf/src/languageserverinstance.jl:185
Stacktrace:
 [1] getstore(ssi::SymbolServerInstance, environment_path::String, progress_callback::LanguageServer.var"#93#95"{LanguageServerInstance}, error_handler::Nothing; download::Bool)
   @ SymbolServer ~/.julia/packages/SymbolServer/GBhfx/src/SymbolServer.jl:47
 [2] macro expansion
   @ ~/.julia/packages/LanguageServer/JrIEf/src/languageserverinstance.jl:182 [inlined]
 [3] (::LanguageServer.var"#92#94"{LanguageServerInstance})()
   @ LanguageServer ./task.jl:411
@clason
Copy link

clason commented Nov 18, 2021

What version of Julia are you using? I suspect it's 1.7.0-beta, which is not guaranteed to be compatible. Try the latest master (add LanguageServer#master).

@jarbus
Copy link
Author

jarbus commented Nov 18, 2021

I'm using 1.6.3. I followed the install instructions for vim, so running

julia --project=/home/jack/.julia/environments/nvim-lspconfig --startup-file=no --history-file=no -e 'ls_install_path = joinpath(get(DEPOT_PATH, 1, joinpath(homedir(), ".julia")), "environments", "nvim-lspconfig"); pushfirst!(LOAD_PATH, ls_install_path);  using LanguageServer; popfirst!(LOAD_PATH); depot_path = get(ENV, "JULIA_DEPOT_PATH", ""); project_path = let; dirname(something( Base.load_path_expand(( p = get(ENV, "JULIA_PROJECT", nothing); p === nothing ? nothing : isempty(p) ? nothing : p )), Base.current_project(), get(Base.load_path(), 1, nothing), Base.load_path_expand("@v#.#"), )) end;   @info "Running language server" VERSION pwd() project_path depot_path;    server = LanguageServer.LanguageServerInstance(stdin, stdout, project_path, depot_path);    server.runlinter = true;    run(server)'

Yields a process that hangs on the following message on the master branch

[ Info: Received new data from Julia Symbol Server.

Is this the intended behavior?

@clason
Copy link

clason commented Nov 18, 2021

I think it would be helpful to fully state your environment:

  1. julia version and platform
  2. client (vim or neovim? what version? which language client)
  3. minimal example (Project.toml for the julia package you're working on and for your global environment)
  4. Exact reproducing steps (consolidated, in your issue description if you weren't using master before) together with the error message and the full log (if available).

@nchisholm
Copy link

nchisholm commented Nov 18, 2021

I was getting the same error as @jarbus using LanguageServer v4.1.0. Switching to #master (4.1.1-DEV) did resolve the error for me, but I am using julia v1.7.0rc2.

@jarbus
Copy link
Author

jarbus commented Nov 18, 2021

I think it would be helpful to fully state your environment:

  1. julia version and platform
  2. client (vim or neovim? what version? which language client)
  3. minimal example (Project.toml for the julia package you're working on and for your global environment)
  4. Exact reproducing steps (consolidated, in your issue description if you weren't using master before) together with the error message and the full log (if available).

Actually LanguageServer.jl seems to work now, I think it only crashes on scripts without an associated Project.toml file. Thanks for the help!

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

3 participants