LanguageServer.jl and Emacs 28/29

Hi. I use emacs for coding in Julia (and almost all other stuff), really happy with it. However, when I try to upgrade my emacs 27.1 to version 28 or 29, the lsp-mode stops working! The problem seems to be about LanguageServer.jl. Maybe some compatibility issue?

Is there anyone, knowing how to solve this issue?

Here is the julia-ls stderr log:

ERROR: MethodError: Cannot `convert` an object of type Dict{String, Any} to an object of type Int64
Closest candidates are:
  convert(::Type{T}, !Matched::T) where T<:Number at /omid/ehsan/softwares/julia-1.7.3/share/julia/base/number.jl:6
  convert(::Type{T}, !Matched::Number) where T<:Number at /omid/ehsan/softwares/julia-1.7.3/share/julia/base/number.jl:7
  convert(::Type{T}, !Matched::Base.TwicePrecision) where T<:Number at /omid/ehsan/softwares/julia-1.7.3/share/julia/base/twiceprecision.jl:262
  ...
Stacktrace:
 [1] convert(#unused#::Type{Union{Nothing, Int64}}, x::Dict{String, Any})
   @ Base ./some.jl:36
 [2] LanguageServer.InitializeParams(processId::Dict{String, Any}, clientInfo::LanguageServer.InfoParams, rootPath::String, rootUri::LanguageServer.URIs2.URI, initializationOptions::Dict{String, Any}, capabilities::LanguageServer.ClientCapabilities, trace::Missing, workspaceFolders::Vector{LanguageServer.WorkspaceFolder}, workDoneToken::String)
   @ LanguageServer ~/.julia/packages/LanguageServer/0vsx2/src/protocol/initialize.jl:98
 [3] LanguageServer.InitializeParams(dict::Dict{String, Any})
   @ LanguageServer ~/.julia/packages/LanguageServer/0vsx2/src/protocol/initialize.jl:116
 [4] dispatch_msg(x::JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint}, dispatcher::JSONRPC.MsgDispatcher, msg::Dict{String, Any})
   @ JSONRPC ~/.julia/packages/JSONRPC/P0G1p/src/typed.jl:65
 [5] run(server::LanguageServerInstance)
   @ LanguageServer ~/.julia/packages/LanguageServer/0vsx2/src/languageserverinstance.jl:382
 [6] top-level scope
   @ none:1

Process julia-ls stderr finished

3 Likes

Little update: I don’t know if it was the origin of the issue, but building Emacs with json support solved the issue.