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 try to go to type definition if the language server does not support it #3802

Closed
Seelengrab opened this issue Sep 11, 2022 · 3 comments
Labels
A-language-server Area: Language server client C-bug Category: This is a bug

Comments

@Seelengrab
Copy link
Contributor

Summary

Ref. julia-vscode/LanguageServer.jl#1155 (comment)

gy should not try to actually request the type location if the server does not support it.

Reproduction Steps

I tried this:

  1. Create a julia source file with this content:
struct Example
    a::Int
end

function foo(bar::Example)
    bar.a
end
  1. Open the file in helix, with the julia LS installed
  2. Move the cursor over the Example in the function signature of bar
  3. Enter gy (nothing happens)
  4. Check the log for the error message of the LS

I expected this to happen:

Ideally, just a log message that the method is not supported by the server.

Instead, this happened:

The language server crashed due to not supporting that method. See the linked github issue for the reasoning why the LS crashes, which is intentional.

Helix log

~/.cache/helix/helix.log

Relevant log section, showing the error message of the LS.

2022-09-11T16:59:49.163 helix_lsp::transport [ERROR] err <- "ERROR: Unknown method textDocument/typeDefinition.\n"
2022-09-11T16:59:49.163 helix_lsp::transport [ERROR] err <- "Stacktrace:\n"
2022-09-11T16:59:49.192 helix_lsp::transport [ERROR] err <- " [1] error(s::String)\n"
2022-09-11T16:59:49.192 helix_lsp::transport [ERROR] err <- "   @ Base ./error.jl:35\n"
2022-09-11T16:59:49.193 helix_lsp::transport [ERROR] err <- " [2] dispatch_msg(x::JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint}, dispatcher::JSONRPC.MsgDispatcher, msg::Dict{String, Any})\n"
2022-09-11T16:59:49.193 helix_lsp::transport [ERROR] err <- "   @ JSONRPC ~/.julia/packages/JSONRPC/P0G1p/src/typed.jl:81\n"
2022-09-11T16:59:49.193 helix_lsp::transport [ERROR] err <- " [3] run(server::LanguageServerInstance)\n"
2022-09-11T16:59:49.193 helix_lsp::transport [ERROR] err <- "   @ LanguageServer ~/.julia/packages/LanguageServer/0vsx2/src/languageserverinstance.jl:382\n"
2022-09-11T16:59:49.194 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-09-11T16:59:49.194 helix_lsp::transport [ERROR] err <- "   @ LanguageServer ~/.julia/packages/LanguageServer/0vsx2/src/runserver.jl:41\n"
2022-09-11T16:59:49.194 helix_lsp::transport [ERROR] err <- " [5] runserver()\n"
2022-09-11T16:59:49.194 helix_lsp::transport [ERROR] err <- "   @ LanguageServer ~/.julia/packages/LanguageServer/0vsx2/src/runserver.jl:39\n"
2022-09-11T16:59:49.194 helix_lsp::transport [ERROR] err <- " [6] top-level scope\n"
2022-09-11T16:59:49.194 helix_lsp::transport [ERROR] err <- "   @ none:1\n"

Platform

Linux 5.19.7-arch1-1

Terminal Emulator

footy

Helix Version

helix 22.08.1

@Seelengrab Seelengrab added the C-bug Category: This is a bug label Sep 11, 2022
@kirawi
Copy link
Member

kirawi commented Sep 11, 2022

I think this is resolved by #3554

@kirawi kirawi added the A-language-server Area: Language server client label Sep 11, 2022
@Seelengrab
Copy link
Contributor Author

While the fix on the helix side (as a precaution) is nice, it seems like the LS shouldn't crash for this in the first place.. julia-vscode/LanguageServer.jl#1155 (comment)

@the-mikedavis
Copy link
Member

Resolved by #3554

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

No branches or pull requests

3 participants