julia-vscode / LanguageServer.jl

An implementation of the Microsoft Language Server Protocol for the Julia language.
Other
360 stars 78 forks source link

InvalidStateException("Channel is closed.", :closed) #1009

Open laubblaeser opened 2 years ago

laubblaeser commented 2 years ago

I've just tried to run LanguageServer and encountered the following error:

julia> using LanguageServer

julia> using LanguageServer.SymbolServer

julia> runserver()
ERROR: MethodError: no method matching (::LanguageServer.var"#93#95"{LanguageServerInstance})(::String, ::Int64)
Closest candidates are:
  (::LanguageServer.var"#93#95")(::Any) at ~/.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:423

I'm on Julia 1.7 with LanguageServer 4.1.0. I've already ried to remove compiled/ and packages/ folders from ~/.julia/ but didn't help. Any ideas what's causing this?

laubblaeser commented 2 years ago

Just tried with add LanguageServer#master and the server boots up without an error message. I suppose the next minor release (4.1.1) will solve the issue and would consider the issue closed.

laubblaeser commented 2 years ago

Right after the server's message [ Info: Received new data from Julia Symbol Server. the next error occurred:

ERROR: InvalidStateException("Channel is closed.", :closed)
Stacktrace:
 [1] take!
   @ ./channels.jl:383 [inlined]
 [2] get_next_message(endpoint::JSONRPC.JSONRPCEndpoint{Base.TTY, Base.TTY})
   @ JSONRPC ~/.julia/packages/JSONRPC/yu0G3/src/core.jl:201
 [3] macro expansion
   @ ~/.julia/packages/LanguageServer/ngKhR/src/languageserverinstance.jl:271 [inlined]
 [4] (::LanguageServer.var"#99#101"{LanguageServerInstance})()
   @ LanguageServer ./task.jl:423

Is my LanguageServer installation really that broken? I remember it working fine with Julia 1.6 before. Might this be a 1.7 bug?

RomeoV commented 3 months ago

I'm running to the "Channel is closed" issue now aswell, on Julia 1.10.4 and LanguageServer.jl 4.5.1, launching with julia --startup-file=no --history-file=no --quiet -e "using LanguageServer; runserver()" inside of a Julia repo.