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

Server crash when using snippets with inlay hints activated #1275

Open
Iorvethe opened this issue Mar 28, 2024 · 0 comments
Open

Server crash when using snippets with inlay hints activated #1275

Iorvethe opened this issue Mar 28, 2024 · 0 comments

Comments

@Iorvethe
Copy link

Iorvethe commented Mar 28, 2024

Reproduction steps (on Helix)

  1. Open Helix
  2. Run command :set lsp.display-inlay-hints true
  3. Enter for (or while)
  4. Wait for snippet completion item
  5. Select it
  6. 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
@Iorvethe Iorvethe changed the title Server crash when using for snippet with inlay hints activated Server crash when using snippets with inlay hints activated Mar 28, 2024
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

1 participant