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

StandardRB LSP server fails to initialize #6506

Closed
benjamineskola opened this issue Mar 31, 2023 · 3 comments
Closed

StandardRB LSP server fails to initialize #6506

benjamineskola opened this issue Mar 31, 2023 · 3 comments
Labels
A-language-server Area: Language server client C-bug Category: This is a bug upstream

Comments

@benjamineskola
Copy link

Summary

Apologies if this is actually a standardrb bug, but as it worked correctly in neovim I thought this was the best place to start.

When configuring standardrb in LSP mode (providing diagnostics and autoformatting), it fails to initialise in Helix. Logs below.

Reproduction Steps

languages.toml:

[[language]]
name = "ruby"
auto-format = true
language-server = { command = "standardrb", args = ["--lsp"] }
$ hx —log standardrb.log -vv foo.rb

Helix log

~/.cache/helix/helix.log
2023-03-31T18:05:46.913 helix_view::clipboard [DEBUG] Using pbcopy+pbpaste to interact with the system clipboard
2023-03-31T18:05:47.112 helix_vcs [ERROR] file is untracked
2023-03-31T18:05:47.112 helix_vcs [ERROR] failed to open diff base for /Users/ben/bin/foo.rb
2023-03-31T18:05:47.114 helix_view::editor [DEBUG] editor status: Loaded 1 file.
2023-03-31T18:05:47.114 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{"general":{"positionEncodings":["utf-8","utf-32","utf-16"]},"textDocument":{"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"completion":{"completionItem":{"deprecatedSupport":true,"insertReplaceSupport":true,"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]},"snippetSupport":true,"tagSupport":{"valueSet":[1]}},"completionItemKind":{}},"hover":{"contentFormat":["markdown"]},"inlayHint":{"dynamicRegistration":false},"publishDiagnostics":{"versionSupport":true},"rename":{"dynamicRegistration":false,"honorsChangeAnnotations":false,"prepareSupport":true},"signatureHelp":{"signatureInformation":{"activeParameterSupport":true,"documentationFormat":["markdown"],"parameterInformation":{"labelOffsetSupport":true}}}},"window":{"workDoneProgress":true},"workspace":{"applyEdit":true,"configuration":true,"didChangeConfiguration":{"dynamicRegistration":false},"executeCommand":{"dynamicRegistration":false},"inlayHint":{"refreshSupport":false},"symbol":{"dynamicRegistration":false},"workspaceEdit":{"documentChanges":true,"failureHandling":"abort","normalizesLineEndings":false,"resourceOperations":["create","rename","delete"]},"workspaceFolders":true}},"clientInfo":{"name":"helix","version":"23.03 (3cf03723)"},"processId":97471,"rootPath":"/Users/ben/bin","rootUri":"file:///Users/ben/bin","workspaceFolders":[{"name":"bin","uri":"file:///Users/ben/bin"}]},"id":0}
2023-03-31T18:05:47.119 helix_tui::backend::crossterm [DEBUG] The keyboard enhancement protocol is not supported in this terminal (checked in 4.652292ms)
2023-03-31T18:05:47.119 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-03-31T18:05:47.315 helix_term::application [DEBUG] received editor event: IdleTimer
2023-03-31T18:05:48.071 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-03-31T18:05:48.225 helix_lsp::transport [INFO] <- {"id":0,"result":{"capabilities":{"textDocumentSync":{"openClose":true,"change":1},"documentFormattingProvider":true,"executeCommandProvider":true,"diagnosticProvider":true}},"jsonrpc":"2.0"}
2023-03-31T18:05:48.225 helix_lsp::transport [INFO] <- {"capabilities":{"diagnosticProvider":true,"documentFormattingProvider":true,"executeCommandProvider":true,"textDocumentSync":{"change":1,"openClose":true}}}
2023-03-31T18:05:48.225 helix_lsp [ERROR] failed to initialize language server: failed to parse: invalid type: boolean `true`, expected struct ExecuteCommandOptions
2023-03-31T18:05:48.317 helix_term::commands::typed [DEBUG] quitting...
2023-03-31T18:05:48.317 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-03-31T18:05:48.473 helix_term::commands::typed [DEBUG] quitting...
2023-03-31T18:05:48.473 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-03-31T18:05:48.473 helix_term::job [DEBUG] waiting on jobs...
2023-03-31T18:05:48.473 helix_term::job [DEBUG] waiting on jobs...
2023-03-31T18:05:48.473 helix_lsp::transport [INFO] Language server not initialized, delaying request
2023-03-31T18:05:51.475 helix_term::application [ERROR] Timed out waiting for language servers to shutdown

Platform

macOS

Terminal Emulator

wezterm 20230326-111934-3666303c

Helix Version

helix 23.03 (3cf0372)

@benjamineskola benjamineskola added the C-bug Category: This is a bug label Mar 31, 2023
@the-mikedavis
Copy link
Member

This is a bug in StandardRB: it's sending "executeCommandProvider":true in the initialization response but that field can't be a boolean in the spec: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#executeCommandOptions

@benjamineskola
Copy link
Author

Thanks for confirming, I've reported it upstream.

@benjamineskola
Copy link
Author

This is fixed in StandardRB 1.25.4.

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 upstream
Projects
None yet
Development

No branches or pull requests

2 participants