-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Unable to use Sorbet LSP for Ruby (LSP invalid method call id=Num(0)) #2786
Comments
The problem here is that Sorbet includes a field not mentioned by the jsonrpc specification. The field I'm not sure how best to solve this problem though. Technically it might be the fault of Sorbet, but maybe the jsonrpc library is stricter than it has to? |
Yeah it looks like it's just that -> {"jsonrpc":"2.0","method":"initialize","params":{...},"id":0}
<- {"id":0,"jsonrpc":"2.0","result":{...}} with sorbet: -> {"jsonrpc":"2.0","method":"initialize","params":{...},"id":0}
<- {"jsonrpc":"2.0","id":0,"requestMethod":"initialize","result":{...}} From the source it looks like it includes |
Could be solved by this issue upstream: paritytech/jsonrpc#595 Or I suppose we might be able to implement jsonrpc within helix itself and drop the |
It might not be as easy as removing deny_unkown_fields though. That could make the untagged feature confused. |
Looks like the compiler is happy to accept the untagged enum without denying unknown fields. Some cases are a bit confused like https://github.com/paritytech/jsonrpc/blob/0a2702595b8831a9a30dec7dc476157c648c361c/core/src/types/response.rs#L260-L281 but I think that's acceptable. |
Hmmmm I wonder if a stopgap measure for my own personal use would be to wrap sorbet in a Thanks for the quick investigation all! Please let me know if there's anything I can do to help (might have some time for small code contributions, or at a minimum I'm happy to test branches along the way)! |
We should not depend on jsonrpc-core anymore: * The project just announced it's no longer actively maintained[^1], preferring their new implementation in `jsonrpsee`. * The types are too strict: we would benefit from removing some `#[serde(deny_unknown_fields)]` annotations to allow language servers that disrespect the spec[^2]. * We don't use much of the project. Just the types out of core. These are easy to embed directly into the `helix-lsp` crate. [^1]: paritytech/jsonrpc#674 [^2]: helix-editor#2786
We should not depend on jsonrpc-core anymore: * The project just announced it's no longer actively maintained[^1], preferring their new implementation in `jsonrpsee`. * The types are too strict: we would benefit from removing some `#[serde(deny_unknown_fields)]` annotations to allow language servers that disrespect the spec[^2]. * We don't use much of the project. Just the types out of core. These are easy to embed directly into the `helix-lsp` crate. [^1]: paritytech/jsonrpc#674 [^2]: #2786
We should not depend on jsonrpc-core anymore: * The project just announced it's no longer actively maintained[^1], preferring their new implementation in `jsonrpsee`. * The types are too strict: we would benefit from removing some `#[serde(deny_unknown_fields)]` annotations to allow language servers that disrespect the spec[^2]. * We don't use much of the project. Just the types out of core. These are easy to embed directly into the `helix-lsp` crate. [^1]: paritytech/jsonrpc#674 [^2]: helix-editor#2786
Just wanted to mention - I pulled and built the latest |
Summary
Trying to use Sorbet as a Ruby LSP so I can move over from Neovim for work as I already have with my side projects, but alas, I can't get the LSP to work. Here's my
~/.config/helix/languages.toml
:Reproduction Steps
I tried this:
hx -vvvvvvvvvvvvvvvv lib/example/typing_example_3.rb
I expected this to happen:
Instead, this happened:
Language server not active for current buffer
when attempting to Space-K for hoverHelix log
~/.cache/helix/helix.log
Platform
Linux
Terminal Emulator
foot-1.12.1_1
Helix Version
helix 22.05
The text was updated successfully, but these errors were encountered: