-
Notifications
You must be signed in to change notification settings - Fork 255
Detect the long first build and tell the user #377
Comments
@nrc @jonathandturner maybe we could introduce a custom server->client notification, such as It seems that there's something being worked on for LSP 4.0 spec (microsoft/language-server-protocol#70), so it might be worth having that in mind. |
The hard bit of this is more on the Cargo side - we don't know whether Cargo is going to rebuild everything or nothing. At the moment we don't know how many crates Cargo is going to build either. We could keep count of how many have been done. Saying exactly which crate is building (or just built) is tricky because we could be building multiple crates in parallel. |
My bad, I wanted to say 'currently building' here, so something like
Cargo also doesn't say which one are actively building now as well, so I think displaying most recently started crate as a least effort attempt could be acceptable here. |
What about working with the cargo team to get some kind of notification API set up? Then we can tell the user exactly which crates are being rebuilt. |
We can get this info at the moment since we intercept every rustc call. I'm not sure how to present this info to the user though. I suppose it is all just wiring it together though. Example problem, the project has two dep crates, foo and bar, foo is very small, bar is very big. They don't depend on each other, but the next crate depends on both of them. We start building bar first, so we flash to the user 'building bar', then we start building foo, so we replace that message with 'building foo', that completes quickly, but we don't start another crate for a long time (because we're waiting for bar), but to the user it looks like foo is taking ages. We could display all crates currently being built, but that would be a bit complicated. |
I'd say we update the progress on both start and end of compilation, so in my previous example we'd update num of actively built crates, as well as the longest compiling till now crate - I don't think it'd still be an issue? |
What about a different message based on plurality? If we're only building one crate, display that, but if we're building more, just display the count. Could we also make it so it's something you can click to display a list of all currently building/built crates? |
this would work, I'm not sure how informative it would be
this too, just a matter of complexity
this too
I don't think vscode has APIs for this, but I might be wrong |
Taking into account both this scenario:
And this suggestion:
I suggest putting all the builds in a stack by most recently started. If there's more than one element, display the count and the build at the top; otherwise display the single element. |
Together with @Xanewok over IRC i started doing this. wip here https://github.com/algesten/rls/tree/progress-params Next step is to calculate the progress percentages and send them back for the two cases:
This currently relies on a fork off languageserver-types 0.16 that adds the |
Did a bit more today. Now started sending some kind of progress message, but there are a couple of issues to resolve.
|
I've opened a PR to get the code review/feedback going. |
If it's possible, can we detect when we're going to have to do a long rebuild and tell the user "Rebuilding dependencies (this may take a few minutes)" or somesuch?
I saw a few people mention not knowing if it was working because the spinner just kept spinning when it was their first build.
The text was updated successfully, but these errors were encountered: