-
Notifications
You must be signed in to change notification settings - Fork 93
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
Various fixes to progress handling #539
Conversation
I'm actually unsure if we want to encourage people to use client-initiated progress, since I'm unsure if it allows cancelling properly: microsoft/language-server-protocol#1873 |
35e1fb4
to
785bb9e
Compare
Okay, I'm going to make it off by default since it's not clear how this will all work. |
1. Server-initiated progress should wait for the client to acknowledge This is an old bug. Per the spec, we're not allowed to send any reports using the token if the client doesn't respond with a non-error response to our creation of the token. This is a bit subtle, because it means we may need to delay the sending of the "begin" notification until we have received the token from the client. 2. No easy way to use client-initiated progress This is simpler and faster than server-initiated progress since you don't need the extra message round-trip. You just need to pull out the progress token (if there is one) from the request and use that. I did two things to make this better: - The progress functions now take the client token if there is one. If there isn't one they still fall back to server-initiated progress. - The server capabilities can now advertise that client-initiated progress is supported.
b9e68ff
to
b6e09c2
Compare
ddd9a98
to
fa0f67f
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
I added some more tests that actually exercise a bunch of the cases, so we can be a bit more confident that this works, hopefully. |
* Various fixes to progress handling 1. Server-initiated progress should wait for the client to acknowledge This is an old bug. Per the spec, we're not allowed to send any reports using the token if the client doesn't respond with a non-error response to our creation of the token. This is a bit subtle, because it means we may need to delay the sending of the "begin" notification until we have received the token from the client. 2. No easy way to use client-initiated progress This is simpler and faster than server-initiated progress since you don't need the extra message round-trip. You just need to pull out the progress token (if there is one) from the request and use that. I did two things to make this better: - The progress functions now take the client token if there is one. If there isn't one they still fall back to server-initiated progress. - The server capabilities can now advertise that client-initiated progress is supported. * Make the default for client-initiated progress to be off * Don't lose progress updates if it takes a while to start * Refactor tests * Add test for cancellation * Fix minor bug in lsp-test config handling * More tests * Try this * Fix formatting * Add comment and purge traces
This is an old bug. Per the spec, we're not allowed to send any reports using the token if the client doesn't respond with a non-error response to our creation of the token.
This is a bit subtle, because it means we may need to delay the sending of the "begin" notification until we have received the token from the client.
This is simpler and faster than server-initiated progress since you don't need the extra message round-trip. You just need to pull out the progress token (if there is one) from the request and use that.
I did two things to make this better: