switch out lsp-types for gen-lsp-types#22115
Conversation
266f7ac to
207d300
Compare
b996006 to
e887c95
Compare
This comment has been minimized.
This comment has been minimized.
db9f359 to
97d9e55
Compare
This comment has been minimized.
This comment has been minimized.
552f6d5 to
b10f69c
Compare
This comment has been minimized.
This comment has been minimized.
b10f69c to
8694af0
Compare
|
Heads up @BenjaminBrienen I just pushed v0.4.0, will probably affect this PR |
|
I already updated to it :) |
fd865d7 to
90f1985
Compare
|
I'm assuming you would like a side of squash with this meal |
554de57 to
9ea32c3
Compare
| // FIXME: Also detect the proposed lsp version at caps.workspace.workspaceEdit.snippetEditSupport | ||
| // once lsp-types has it. |
There was a problem hiding this comment.
I already have a draft PR based on top of this one that implements the split and uses the capability properly, so I just removed the comment for now. Is that fine?
There was a problem hiding this comment.
Going through all of the it.method == R::METHOD changes made me realize that there's no request-equivalent helper function of notification_is 😅
My main concern though is if the file:// scheme is still required though, as I think the tests ensure that we're emitting self-consistent values rather than if those values actually make sense for the LS client.
| // FIXME: Also detect the proposed lsp version at caps.workspace.workspaceEdit.snippetEditSupport | ||
| // once lsp-types has it. |
There was a problem hiding this comment.
I hadn't known about the draft PR, sorry!
b6b4eca to
f1abaaa
Compare
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
|
4e097a1 to
c7b031d
Compare
bee3902 to
e55875b
Compare
[gen-lsp-types](https://github.com/ribru17/gen-lsp-types) is an alternative to the lsp-types crate, with types generated via codegen from the official LSP Metamodel for correctness and completeness. lsp-types issues fixed in gen-lsp-types: - gluon-lang/lsp-types#310 - gluon-lang/lsp-types#308 - gluon-lang/lsp-types#284 - gluon-lang/lsp-types#278 - gluon-lang/lsp-types#277 - gluon-lang/lsp-types#260 - gluon-lang/lsp-types#245 - gluon-lang/lsp-types#93 See: wgsl-analyzer/wgsl-analyzer#1090 and rust-lang/rust-analyzer#22115
[gen-lsp-types](https://github.com/ribru17/gen-lsp-types) is an alternative to the lsp-types crate, with types generated via codegen from the official LSP Metamodel for correctness and completeness. lsp-types issues fixed in gen-lsp-types: - gluon-lang/lsp-types#310 - gluon-lang/lsp-types#308 - gluon-lang/lsp-types#284 - gluon-lang/lsp-types#278 - gluon-lang/lsp-types#277 - gluon-lang/lsp-types#260 - gluon-lang/lsp-types#245 - gluon-lang/lsp-types#93 See: wgsl-analyzer/wgsl-analyzer#1090 and rust-lang/rust-analyzer#22115
|
☔ The latest upstream changes (possibly #22284) made this pull request unmergeable. Please resolve the merge conflicts. |
[gen-lsp-types](https://github.com/ribru17/gen-lsp-types) is an alternative to the lsp-types crate, with types generated via codegen from the official LSP Metamodel for correctness and completeness. lsp-types issues fixed in gen-lsp-types: - gluon-lang/lsp-types#310 - gluon-lang/lsp-types#308 - gluon-lang/lsp-types#284 - gluon-lang/lsp-types#278 - gluon-lang/lsp-types#277 - gluon-lang/lsp-types#260 - gluon-lang/lsp-types#245 - gluon-lang/lsp-types#93 See rust-lang/rust-analyzer#22115 and wgsl-analyzer/wgsl-analyzer#1090 for other migration considerations.
[gen-lsp-types](https://github.com/ribru17/gen-lsp-types) is an alternative to the lsp-types crate, with types generated via codegen from the official LSP Metamodel for correctness and completeness. lsp-types issues fixed in gen-lsp-types: - gluon-lang/lsp-types#310 - gluon-lang/lsp-types#308 - gluon-lang/lsp-types#284 - gluon-lang/lsp-types#278 - gluon-lang/lsp-types#277 - gluon-lang/lsp-types#260 - gluon-lang/lsp-types#245 - gluon-lang/lsp-types#93 See: wgsl-analyzer/wgsl-analyzer#1090 and rust-lang/rust-analyzer#22115
[gen-lsp-types](https://github.com/ribru17/gen-lsp-types) is an alternative to the lsp-types crate, with types generated via codegen from the official LSP Metamodel for correctness and completeness. lsp-types issues fixed in gen-lsp-types: - gluon-lang/lsp-types#310 - gluon-lang/lsp-types#308 - gluon-lang/lsp-types#284 - gluon-lang/lsp-types#278 - gluon-lang/lsp-types#277 - gluon-lang/lsp-types#260 - gluon-lang/lsp-types#245 - gluon-lang/lsp-types#93 See: wgsl-analyzer/wgsl-analyzer#1090 and rust-lang/rust-analyzer#22115
[gen-lsp-types](https://github.com/ribru17/gen-lsp-types) is an alternative to the lsp-types crate, with types generated via codegen from the official LSP Metamodel for correctness and completeness. lsp-types issues fixed in gen-lsp-types: - gluon-lang/lsp-types#310 - gluon-lang/lsp-types#308 - gluon-lang/lsp-types#284 - gluon-lang/lsp-types#278 - gluon-lang/lsp-types#277 - gluon-lang/lsp-types#260 - gluon-lang/lsp-types#245 - gluon-lang/lsp-types#93 See: wgsl-analyzer/wgsl-analyzer#1090 and rust-lang/rust-analyzer#22115
|
If you could rebase once more, will get this merged then 🙏 |
|
@Veykril If I can ask a question from the peanut gallery... Isn't there some inherent risk with swapping to a library that's less than 2 months old, from an (admittedly unmaintained) stable one? It's also not a drop-in replacement, unfortunately (hence the 2k line diff). As an example, the version in Cargo.toml is already 2 versions out of date (0.4.0 instead of 0.6.0). I've seen @ribru17 send PRs of this library to a lot of other projects who are depending on gluon's lsp_types - and then referencing this PR as social proof for it going in. That feels gross to me - but OSS libs are a chicken/egg problem, so there's that. Anyways, just raising a flag as someone who maintains a bunch of OSS projects and LSP servers (using lsp_server) - take this comment with whatever grains of salt are required. Personally I was hoping that Microsoft's lsprotocol would have gone somewhere, and solved this problem. I've vendored Helix's lsp-types in my projects for now. Edit: Changed spam to send - as the former sounded too much like a personal attack, while this is a comment about technical stability and long-term viability. |
|
@stothej we're switching from a hand-written crate to an automatically generated one, which is somewhat we've wanted anyway. Even if the author goes away, we can take over or fork it, and it's going to be easier. Most of the 2000-line diff is to test outputs (because fields were missing in the old crate) and different module and struct names.
Which seems totally fair, given that ribru17 listened to our feedback incorporated the changes we've requested. |
# Objective Better correctness and use a maintained crate. ## Solution Adapt rust-lang/rust-analyzer#22115 ## Testing Changes are 1:1 with r-a and the tests there were good. We don't have those tests adapted yet.
Blocked on:
From<&str>for string enums with custom values ribru17/gen-lsp-types#8LspRequestMethods::Customshould take a&'static strribru17/gen-lsp-types#9crate::Idandcrate::generated::Idribru17/gen-lsp-types#10mod json_rpcto avoid name collisions ribru17/gen-lsp-types#11Alternative to: #22108