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

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

Closed
Seelengrab opened this issue Oct 14, 2022 · 1 comment · Fixed by #3554
Closed

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

Seelengrab opened this issue Oct 14, 2022 · 1 comment · Fixed by #3554
Labels
A-language-server Area: Language server client C-bug Category: This is a bug

Comments

@Seelengrab
Copy link
Contributor

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:

pub fn goto_implementation(
&self,
text_document: lsp::TextDocumentIdentifier,
position: lsp::Position,
work_done_token: Option<lsp::ProgressToken>,
) -> impl Future<Output = Result<Value>> {
self.goto_request::<lsp::request::GotoImplementation>(
text_document,
position,
work_done_token,
)
}

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
Copy link
Contributor Author

Probably fixed by #3554

@archseer archseer linked a pull request Oct 14, 2022 that will close this issue
@the-mikedavis the-mikedavis added the A-language-server Area: Language server client label Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-server Area: Language server client C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants