LanguageServer.jl
LanguageServer.jl copied to clipboard
Server crash when using snippets with inlay hints activated
Reproduction steps (on Helix)
- Open Helix
- Run command
:set lsp.display-inlay-hints true
- Enter
for
(orwhile
) - Wait for snippet completion item
- Select it
- Crash
Versions
- Helix: 23.10
- LanguageServer: v4.5.1
Backtrace
original_error=ERROR: BoundsError: attempt to access 4-element Vector{Int64} at index [6]
Stacktrace:
[1] getindex
@ ./essentials.jl:13 [inlined]
[2] get_offset(doc::LanguageServer.TextDocument, line::Int64, character::Int64)
@ LanguageServer ~/.julia/packages/LanguageServer/Fwm1f/src/textdocument.jl:227
[3] get_offset
@ ~/.julia/packages/LanguageServer/Fwm1f/src/document.jl:75 [inlined]
[4] get_offset
@ ~/.julia/packages/LanguageServer/Fwm1f/src/document.jl:76 [inlined]
[5] textDocument_inlayHint_request(params::LanguageServer.InlayHintParams, server::LanguageServerInstance, conn::JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint})
@ LanguageServer ~/.julia/packages/LanguageServer/Fwm1f/src/requests/features.jl:587
[6] (::LanguageServer.var\"#116#117\"{typeof(LanguageServer.textDocument_inlayHint_request), LanguageServerInstance})(conn::JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint}, params::LanguageServer.InlayHintParams)
@ LanguageServer ~/.julia/packages/LanguageServer/Fwm1f/src/languageserverinstance.jl:273
[7] dispatch_msg(x::JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint}, dispatcher::JSONRPC.MsgDispatcher, msg::Dict{String, Any})
@ JSONRPC ~/.julia/packages/JSONRPC/Q0FBr/src/typed.jl:67
[8] run(server::LanguageServerInstance; timings::Vector{Any})
@ LanguageServer ~/.julia/packages/LanguageServer/Fwm1f/src/languageserverinstance.jl:405
[9] run
@ ~/.julia/packages/LanguageServer/Fwm1f/src/languageserverinstance.jl:283 [inlined]
[10] runserver(pipe_in::Base.PipeEndpoint, pipe_out::Base.PipeEndpoint, env_path::String, depot_path::String, err_handler::Nothing, symserver_store_path::Nothing)
@ LanguageServer ~/.julia/packages/LanguageServer/Fwm1f/src/runserver.jl:41
[11] runserver()
@ LanguageServer ~/.julia/packages/LanguageServer/Fwm1f/src/runserver.jl:39
[12] top-level scope
@ none:1
[13] eval
@ ./boot.jl:385 [inlined]
[14] exec_options(opts::Base.JLOptions)
@ Base ./client.jl:291
[15] _start()
@ Base ./client.jl:552
Stacktrace:
[1] get_offset(doc::LanguageServer.TextDocument, line::Int64, character::Int64)
@ LanguageServer ~/.julia/packages/LanguageServer/Fwm1f/src/textdocument.jl:245
[2] get_offset
@ ~/.julia/packages/LanguageServer/Fwm1f/src/document.jl:75 [inlined]
[3] get_offset
@ ~/.julia/packages/LanguageServer/Fwm1f/src/document.jl:76 [inlined]
[4] textDocument_inlayHint_request(params::LanguageServer.InlayHintParams, server::LanguageServerInstance, conn::JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint})
@ LanguageServer ~/.julia/packages/LanguageServer/Fwm1f/src/requests/features.jl:587
[5] (::LanguageServer.var\"#116#117\"{typeof(LanguageServer.textDocument_inlayHint_request), LanguageServerInstance})(conn::JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint}, params::LanguageServer.InlayHintParams)
@ LanguageServer ~/.julia/packages/LanguageServer/Fwm1f/src/languageserverinstance.jl:273
[6] dispatch_msg(x::JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint}, dispatcher::JSONRPC.MsgDispatcher, msg::Dict{String, Any})
@ JSONRPC ~/.julia/packages/JSONRPC/Q0FBr/src/typed.jl:67
[7] run(server::LanguageServerInstance; timings::Vector{Any})
@ LanguageServer ~/.julia/packages/LanguageServer/Fwm1f/src/languageserverinstance.jl:405
[8] run
@ ~/.julia/packages/LanguageServer/Fwm1f/src/languageserverinstance.jl:283 [inlined]
[9] runserver(pipe_in::Base.PipeEndpoint, pipe_out::Base.PipeEndpoint, env_path::String, depot_path::String, err_handler::Nothing, symserver_store_path::Nothing)
@ LanguageServer ~/.julia/packages/LanguageServer/Fwm1f/src/runserver.jl:41
[10] runserver()
@ LanguageServer ~/.julia/packages/LanguageServer/Fwm1f/src/runserver.jl:39
[11] top-level scope
@ none:1
caused by: BoundsError: attempt to access 4-element Vector{Int64} at index [6]
Stacktrace:
[1] getindex
@ ./essentials.jl:13 [inlined]
[2] get_offset(doc::LanguageServer.TextDocument, line::Int64, character::Int64)
@ LanguageServer ~/.julia/packages/LanguageServer/Fwm1f/src/textdocument.jl:227
[3] get_offset
@ ~/.julia/packages/LanguageServer/Fwm1f/src/document.jl:75 [inlined]
[4] get_offset
@ ~/.julia/packages/LanguageServer/Fwm1f/src/document.jl:76 [inlined]
[5] textDocument_inlayHint_request(params::LanguageServer.InlayHintParams, server::LanguageServerInstance, conn::JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint})
@ LanguageServer ~/.julia/packages/LanguageServer/Fwm1f/src/requests/features.jl:587
[6] (::LanguageServer.var\"#116#117\"{typeof(LanguageServer.textDocument_inlayHint_request), LanguageServerInstance})(conn::JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint}, params::LanguageServer.InlayHintParams)
@ LanguageServer ~/.julia/packages/LanguageServer/Fwm1f/src/languageserverinstance.jl:273
[7] dispatch_msg(x::JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint}, dispatcher::JSONRPC.MsgDispatcher, msg::Dict{String, Any})
@ JSONRPC ~/.julia/packages/JSONRPC/Q0FBr/src/typed.jl:67
[8] run(server::LanguageServerInstance; timings::Vector{Any})
@ LanguageServer ~/.julia/packages/LanguageServer/Fwm1f/src/languageserverinstance.jl:405
[9] run
@ ~/.julia/packages/LanguageServer/Fwm1f/src/languageserverinstance.jl:283 [inlined]
[10] runserver(pipe_in::Base.PipeEndpoint, pipe_out::Base.PipeEndpoint, env_path::String, depot_path::String, err_handler::Nothing, symserver_store_path::Nothing)
@ LanguageServer ~/.julia/packages/LanguageServer/Fwm1f/src/runserver.jl:41
[11] runserver()
@ LanguageServer ~/.julia/packages/LanguageServer/Fwm1f/src/runserver.jl:39
[12] top-level scope
@ none:1