-
Notifications
You must be signed in to change notification settings - Fork 92
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
Add LSP functionality to Rover #2272
Conversation
✅ Docs preview has no changesThe preview was not built because there were no changes. Build ID: 78e8da5fde3c5380079965a8 |
9d740fa
to
91bbdc6
Compare
src/command/lsp/mod.rs
Outdated
// TODO: Let the supergraph binary exist inside its own task that can respond to being re-installed etc. | ||
let supergraph_binary = | ||
InstallSupergraph::new(federation_version.clone(), client_config.clone()) | ||
.install( | ||
None, | ||
lsp_opts.plugin_opts.elv2_license_accepter, | ||
lsp_opts.plugin_opts.skip_update, | ||
) | ||
.await?; |
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.
One of the features (I think) of the old PR is that it allows people to update the version of Federation inside the supergraph.yaml
while it's running. When doing the dev
refactor we made an explicit decision that we didn't want to support that behaviour. Is that a dealbreaker for the LSP? Or could we ship this as is and see if there's sufficient demand after the fact to implement that?
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.
It's a pretty bad UX to not watch supergraph.yaml
because the way to manually restart the language server underneath VS Code is really clunky—and it's not at all obvious when you should do that. If someone modifies their supergraph.yaml
file and still sees out of date validations, it's going to be frustrating.
Also a general comment: @dylan-apollo I couldn't see a way to inject a |
2a746aa
to
c02e230
Compare
@jonathanrainer there is an |
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.
slapping a like & subscribe on this bad boy because I think it's mergeable as-is, though I know you'll make certain changes here and there (request re-review if you want); I haven't actually tried this out in the wild, though, but not sure that's really on our team to do
c02e230
to
eb509d3
Compare
7311712
to
e443b00
Compare
24ba4ff
to
f993ef7
Compare
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.
Looks good to me (ignoring the couple tickets we're tracking separately)! I think we're basically at the point where we need to start using it regularly to find any edge cases. Thanks all for powering through this epic 🫶
dcaa3a6
to
487336e
Compare
Clumps together other minor fixes without them dirtying other bits of the commit history.
Takes the approach of dumping the existing LSP code straight into what we have and integrating it to the point of compilation.
We need to emit extra events here such that the LSP can react to them
At present, we only support 2 composition output targets, this adds a third, which means that the output of composition only exists in memory. This means we don't have to write/manage temporary files, and we don't compete with the LSP for usage of stdout.
We want to set a sensible default here (5 seconds), while giving users the ability to override it if that becomes problematic.
487336e
to
15a3c47
Compare
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.
lgtm!
@@ -73,6 +73,8 @@ apollo-encoder = "0.8" | |||
# https://github.com/apollographql/federation-rs | |||
apollo-federation-types = "0.14.1" | |||
|
|||
apollo-language-server = { version = "0.3.4", default-features = false, features = ["tokio"] } |
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.
is the latest version? I want to say I saw a bump recently; might be worth a follow-up with it, if there was one
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.
Now that the LSP has been finalised, and composition has been refactored such that it can consume events in the same way that
rover dev
does we can unify the two together.This has been tested by running a custom build version of Rover against VSCode and it seems to function as intended. We will need to hash out a few more things in the review overall but this is a very positive step forwards