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

helix doesn't seem to check server capabilities before doing a request #3540

Closed
artempyanykh opened this issue Aug 25, 2022 · 0 comments · Fixed by #3554
Closed

helix doesn't seem to check server capabilities before doing a request #3540

artempyanykh opened this issue Aug 25, 2022 · 0 comments · Fixed by #3554
Labels
A-language-server Area: Language server client C-bug Category: This is a bug

Comments

@artempyanykh
Copy link
Contributor

artempyanykh commented Aug 25, 2022

Summary

See artempyanykh/marksman#54 for details.

Marksman v2022-08-19 doesn't support workspace symbols. It doesn't advertise it in server capabilities. Yet Helix still sends a workspace symbols request to the server upon hitting <space>-S. Which hits notImplemented in the server's code and causes it to crash; the crash has since been fixed though.

IIUC, the client should not send a request for an unsupported method.

Reproduction Steps

  1. Download https://github.com/artempyanykh/marksman/releases/tag/2022-08-19;
  2. Set up the LSP https://github.com/artempyanykh/marksman#existing-editor-integrations3;
  3. Open a markdown file and hit <space>-S.

Helix log

~/.cache/helix/helix.log
2022-08-25T10:00:34.113 helix_view::theme [WARN] Theme: malformed hexcode: highlight
2022-08-25T10:00:34.359 helix_lsp::transport [ERROR] err <- "[10:00:34 INF] <LSP Entry> Starting Marksman LSP server: {}\n"
2022-08-25T10:00:44.912 helix_lsp::transport [ERROR] err <- "Unhandled exception: System.AggregateException: One or more errors occurred. (Method not found)\n"
2022-08-25T10:00:44.913 helix_lsp::transport [ERROR] err <- " ---> StreamJsonRpc.LocalRpcException: Method not found\n"
2022-08-25T10:00:44.913 helix_lsp::transport [ERROR] err <- "   at Ionide.LanguageServerProtocol.Server.asyncContinuation@43-1.Invoke(FSharpResult`2 lspResult) in /Users/arr/dev/marksman/LanguageServerProtocol/LanguageServerProtocol.fs:line 43\n"
2022-08-25T10:00:44.913 helix_lsp::transport [ERROR] err <- "   at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvokeNoHijackCheck[a,b](AsyncActivation`1 ctxt, b result1, FSharpFunc`2 userCode) in D:\\a\\_work\\1\\s\\src\\fsharp\\FSharp.Core\\async.fs:line 465\n"
2022-08-25T10:00:44.913 helix_lsp::transport [ERROR] err <- "   at Ionide.LanguageServerProtocol.ServerUtil.notImplemented@7-2.Invoke(AsyncActivation`1 ctxt)\n"
2022-08-25T10:00:44.913 helix_lsp::transport [ERROR] err <- "   at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction) in D:\\a\\_work\\1\\s\\src\\fsharp\\FSharp.Core\\async.fs:line 104\n"
2022-08-25T10:00:44.913 helix_lsp::transport [ERROR] err <- "   --- End of inner exception stack trace ---\n"
2022-08-25T10:00:44.913 helix_lsp::transport [ERROR] err <- "   at Ionide.LanguageServerProtocol.Server.startWithSetup[client](FSharpFunc`2 setupRequestHandlings, Stream input, Stream output, FSharpFunc`2 clientCreator) in /Users/arr/dev/marksman/LanguageServerProtocol/LanguageServerProtocol.fs:line 174\n"
2022-08-25T10:00:44.913 helix_lsp::transport [ERROR] err <- "   at Marksman.Program.startLSP(Int32 verbosity, Boolean waitForDebugger) in /Users/arr/dev/marksman/Marksman/Program.fs:line 58\n"
2022-08-25T10:00:44.913 helix_lsp::transport [ERROR] err <- "   at [email protected](Tuple`2 tupledArg)\n"
2022-08-25T10:00:44.913 helix_lsp::transport [ERROR] err <- "   at FSharp.SystemCommandLine.CommandBuilders.SetHandlerInt@207-2.Invoke(InvocationContext ctx)\n"
2022-08-25T10:00:44.913 helix_lsp::transport [ERROR] err <- "   at System.CommandLine.Invocation.AnonymousCommandHandler.Invoke(InvocationContext )\n"
2022-08-25T10:00:44.913 helix_lsp::transport [ERROR] err <- "   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()\n"
2022-08-25T10:00:44.913 helix_lsp::transport [ERROR] err <- "--- End of stack trace from previous location ---\n"
2022-08-25T10:00:44.913 helix_lsp::transport [ERROR] err <- "   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass17_0.<<UseParseErrorReporting>b__0>d.MoveNext()\n"
2022-08-25T10:00:44.913 helix_lsp::transport [ERROR] err <- "--- End of stack trace from previous location ---\n"
2022-08-25T10:00:44.913 helix_lsp::transport [ERROR] err <- "   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass12_0.<<UseHelp>b__0>d.MoveNext()\n"
2022-08-25T10:00:44.913 helix_lsp::transport [ERROR] err <- "--- End of stack trace from previous location ---\n"
2022-08-25T10:00:44.913 helix_lsp::transport [ERROR] err <- "   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseVersionOption>b__0>d.MoveNext()\n"
2022-08-25T10:00:44.913 helix_lsp::transport [ERROR] err <- "--- End of stack trace from previous location ---\n"
2022-08-25T10:00:44.913 helix_lsp::transport [ERROR] err <- "   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass19_0.<<UseTypoCorrections>b__0>d.MoveNext()\n"
2022-08-25T10:00:44.913 helix_lsp::transport [ERROR] err <- "--- End of stack trace from previous location ---\n"
2022-08-25T10:00:44.913 helix_lsp::transport [ERROR] err <- "   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__18_0>d.MoveNext()\n"
2022-08-25T10:00:44.913 helix_lsp::transport [ERROR] err <- "--- End of stack trace from previous location ---\n"
2022-08-25T10:00:44.913 helix_lsp::transport [ERROR] err <- "   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseParseDirective>b__0>d.MoveNext()\n"
2022-08-25T10:00:44.913 helix_lsp::transport [ERROR] err <- "--- End of stack trace from previous location ---\n"
2022-08-25T10:00:44.913 helix_lsp::transport [ERROR] err <- "   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__5_0>d.MoveNext()\n"
2022-08-25T10:00:44.913 helix_lsp::transport [ERROR] err <- "--- End of stack trace from previous location ---\n"
2022-08-25T10:00:44.913 helix_lsp::transport [ERROR] err <- "   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass8_0.<<UseExceptionHandler>b__0>d.MoveNext()\n"
2022-08-25T10:00:44.920 helix_lsp::transport [ERROR] err: <- StreamClosed
2022-08-25T10:00:44.920 helix_lsp::transport [ERROR] err: <- StreamClosed
2022-08-25T10:00:45.392 helix_term::application [ERROR] Timed out waiting for language servers to shutdown

Platform

macOS

Terminal Emulator

iTerm2

Helix Version

helix 22.05 (45add73)

@artempyanykh artempyanykh added the C-bug Category: This is a bug label Aug 25, 2022
@the-mikedavis the-mikedavis added the A-language-server Area: Language server client label Aug 25, 2022
@the-mikedavis the-mikedavis linked a pull request Aug 26, 2022 that will close this issue
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