helix icon indicating copy to clipboard operation
helix copied to clipboard

Don't request `textDocument/implementation` if the server does not support it

Open Seelengrab opened this issue 3 years ago • 1 comments

Summary

Currently, helix blindly requests textDocument/implementation without checking whether the server actually supports it. I've been pointed to the following place where this should be added:

https://github.com/helix-editor/helix/blob/13d81b74787b58c01b56fdac8e3515470b2ed127/helix-lsp/src/client.rs#L848-L859

Reproduction Steps

I tried this:

  1. hx on a julia file
  2. gi on a function use

I expected this to happen:

The editor scrolls to the function in question.

Instead, this happened:

The LSP crashed, due to not supporting textDocument/implementation.

Helix log

~/.cache/helix/helix.log
2022-10-14T10:23:04.514 helix_lsp::transport [ERROR] err <- "[ Info: Received new data from Julia Symbol Server.\n"
2022-10-14T10:28:15.955 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path }
2022-10-14T10:34:55.194 helix_lsp::transport [ERROR] err <- "[ Info: Received new data from Julia Symbol Server.\n"
2022-10-14T11:07:22.484 helix_view::editor [ERROR] Failed to initialize the LSP for `source.md` { LSP not defined }
2022-10-14T12:16:48.955 helix_lsp::transport [ERROR] err <- "ERROR: Unknown method textDocument/implementation.\n"
2022-10-14T12:16:48.955 helix_lsp::transport [ERROR] err <- "Stacktrace:\n"
2022-10-14T12:16:48.976 helix_lsp::transport [ERROR] err <- " [1] error(s::String)\n"
2022-10-14T12:16:48.976 helix_lsp::transport [ERROR] err <- "   @ Base ./error.jl:35\n"
2022-10-14T12:16:48.978 helix_lsp::transport [ERROR] err <- " [2] dispatch_msg(x::JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint}, dispatcher::JSONRPC.MsgDispatcher, msg::Dict{String, Any})\n"
2022-10-14T12:16:48.978 helix_lsp::transport [ERROR] err <- "   @ JSONRPC ~/.julia/packages/JSONRPC/P0G1p/src/typed.jl:81\n"
2022-10-14T12:16:48.978 helix_lsp::transport [ERROR] err <- " [3] run(server::LanguageServerInstance)\n"
2022-10-14T12:16:48.978 helix_lsp::transport [ERROR] err <- "   @ LanguageServer ~/.julia/packages/LanguageServer/0vsx2/src/languageserverinstance.jl:382\n"
2022-10-14T12:16:48.979 helix_lsp::transport [ERROR] err <- " [4] runserver(pipe_in::Base.PipeEndpoint, pipe_out::Base.PipeEndpoint, env_path::String, depot_path::String, err_handler::Nothing, symserver_store_path::Nothing)\n"
2022-10-14T12:16:48.979 helix_lsp::transport [ERROR] err <- "   @ LanguageServer ~/.julia/packages/LanguageServer/0vsx2/src/runserver.jl:41\n"
2022-10-14T12:16:48.979 helix_lsp::transport [ERROR] err <- " [5] runserver()\n"
2022-10-14T12:16:48.979 helix_lsp::transport [ERROR] err <- "   @ LanguageServer ~/.julia/packages/LanguageServer/0vsx2/src/runserver.jl:39\n"
2022-10-14T12:16:48.979 helix_lsp::transport [ERROR] err <- " [6] top-level scope\n"
2022-10-14T12:16:48.979 helix_lsp::transport [ERROR] err <- "   @ none:1\n"
2022-10-14T12:16:48.994 helix_lsp::transport [ERROR] err: <- StreamClosed
2022-10-14T12:16:48.994 helix_lsp::transport [ERROR] err: <- StreamClosed
2022-10-14T12:19:36.311 helix_lsp::transport [ERROR] err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2022-10-14T12:19:36.812 helix_term::application [ERROR] Timed out waiting for language servers to shutdown

Platform

Linux 5.19.7-arch1-1

Terminal Emulator

footy

Helix Version

helix 22.08.1

Seelengrab avatar Oct 14 '22 10:10 Seelengrab

Probably fixed by https://github.com/helix-editor/helix/pull/3554

Seelengrab avatar Oct 14 '22 10:10 Seelengrab