-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
refactor: rewrite lsp to use lspower #8727
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, it feels like the right track but a couple of things:
- renaming
lsp
tolsp2
just makes the PR infinitely more difficult to read and feels totally arbitrary. If we had to have two language servers running for a while, then we would want to uselsp2
but this PR fully removeslsp
in lieu oflsp2
. - some of the arbitrary renaming of things also makes it difficult to read, there is no problem with doing a rename PR as a seperate PR first.
- I really think we should hold off on it until we a stable crate published to replace lsp server. There is no harm in waiting a little while to have the PRs accepted or the alternative crate published.
I know we landed the original LSP as a big ole PR, but it was hard to avoid that... I think we should really try to do things in smaller chunks now.
Yes - I am going to remove lsp 1 in and move to rename lsp2 to lsp. It was just easier to copy paste chunks in small batches rather than porting everything in the same commit :-)
I dont think I did any major renames. Could you point me to what you mean?
Yup - but mainly a chicken and egg problem. I can get this out to crates.io, but I am not going to unless we agree that we want to go with
Agree - but I don't think that is possible with this PR. It completely replaces the core of the lsp. If you have ideas about how we could do this, I can split it up. |
- server_state
+ state_snapshot
- ServerStateSnapshot
+ StateSnapshot I'm fine with the change, but there were a lot of lines in this PR that were just "noise" around those renames.
How big would |
We are pretty much using all of lspower. We dont support all language server APIs, but there is no big feature we dont use.
It needs to update to 0.3 when we do. I checked, and this is trivial. Only 3 lines change compared to 0.2. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good... the term "backend" is really bothering me though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
I guess it is just a decision about what we do about waiting for lspower. I will defer to @ry on that one.
lspower is published to crates now. Just need to switch the cargo toml line. Also still need to fix the unit test in backend.rs and rename that file to language_server.rs. |
Co-authored-by: Luca Casonato <[email protected]>
This PR investigates if we could use
tower-lsp
as our LSP server framework.tower-lsp
is an async LSP implementation written usingtower
(same frameworkhyper
andtonic
are built on). It uses the same underlyinglsp_types
crate for the protocol aslsp_server
.It has some nice usability benefits over
lsp_server
:lsp_server
.TODO:
tower-lsp
.