-
Notifications
You must be signed in to change notification settings - Fork 727
Handle restore on the server #8780
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
base: main
Are you sure you want to change the base?
Conversation
94d8046 to
f88f252
Compare
| languageServer.registerOnRequest(ProjectNeedsRestoreRequest.type, async (params) => { | ||
| let projectFilePaths = params.projectFilePaths; | ||
| if (getCSharpDevKit()) { | ||
| // Only restore '.cs' files (file-based apps) if CDK is loaded. |
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.
really nice to delete this also.
| showOutput: boolean | ||
| projectFiles: string[] | ||
| ): Promise<void> { | ||
| if (_restoreInProgress) { |
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 this tracks only restores initiated by the client. Parallel restores on different things are still permitted on the server side. Perhaps that is what we want? At least there doesn't seem to be a need to make a change to that in this PR.
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.
right. don't want really multiple manually initiated restores running at once. But server can run automatic restores for diff projects
Followup to the canonical misc changes. This PR has two parts ## Move server initiated restore entirely to server Previously restores initiated by the server had to call out to the client to setup the correct UI, which then called back to the server to run the restore, all using custom LSP requests. This wasn't ideal as it meant extra custom client side code and an extra server -> client -> server loop. Instead, we can utilize the standard LSP [server initiated work done progress](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#serverInitiatedProgress) API to display progress from the server on the client side. This means server initiated restores no longer need any custom client code, and the server can choose when to display a UI without a client code change. This did require a bit of complex code to handle either the server or client cancelling the request. Additionally, we still have custom requests for manually initiated restores from the client. ## Hide restore progress for canonical files Utilizing the above change, I modified the server behavior to not show any progress when restoring the canonical file. This is an internal server operation and does not need to be displayed client side (based on feedback it only causes confusion). CLient side change - dotnet/vscode-csharp#8780
No description provided.