Comments (8)
Because client-initiated progress is tied to client requests, it seems to me that the client cancels the request and anything associated with it, such as progress, with $/cancelRequest
.
Because server-initiated progress can start at any moment, not being tied to a request, clients need some way to cancel the background computation. Using window/workDoneProgress/cancel
in this case.
from language-server-protocol.
So if we have the following sequence:
- Client-initiated progress token
- Server sends a
begin
report withcancellable: true
- The user clicks the cancel button
Is the client supposed to cancel the action with $/cancel
? From the client perspective that seems more complicated, and I wouldn't be surprised if many of them just send a window/workDoneProgress/cancel
.
From the server side it's not any harder to support window/workDoneProgress/cancel
for all progress tokens, so I'll probably do that regardless. But it would be nice if the spec was clearer.
from language-server-protocol.
@Rowls thanks for the great explanation.
@michaelpj the only sentence we could add is to say that client side progress is to be canceled using $/cancel
message since they are bound to a request in the first place.
window/workDoneProgress/cancel
is a server to client message only. So clients should never sent them to the server.
from language-server-protocol.
Added a clarifying sentence.
from language-server-protocol.
window/workDoneProgress/cancel is a server to client message only. So clients should never sent them to the server.
I think you mean the opposite? https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#window_workDoneProgress_cancel
I think the helpful sentence to add would be one to the section on window/workDoneProgress/cancel
, something like: "A client should not send a window/workDoneProgress/cancel
notification for a client-initiated progress token (instead it should use $/cancel
to cancel the associated request). If a server receives such a notification it should ignore it and should not cancel the request."
Is that right?
from language-server-protocol.
That is more or less the sentence I added:
Canceling work done progress is done by simply canceling the corresponding request.
from language-server-protocol.
And you are correct. The window/workDoneProgress/cancel
is a client to server message.
Client initiated progress is always bound to a request. It can't exist by itself.
from language-server-protocol.
Your sentence doesn't say
- Clients can't cancel client-initiated progress with
window/workDoneProgress/cancel
. My text says they should not do that. - What the server should do if it receives a
window/workDoneProgess/cancel
notification for a client-initiated progress token. My text explicitly says that it should ignore it.
from language-server-protocol.
Related Issues (20)
- Allow server to clear a ShowMessage notifications, via timeout or token
- MetaModel.json use during LSP implementation HOT 12
- Specify exactly what "the client will normalize line ending characters" means HOT 2
- Clarify docs: deltaLine and deltaStart fields of semantic tokens relate to the _start_ of the previous token HOT 2
- MetaModel: Missing Types and `TraceValue` vs `TraceValues` HOT 2
- What's the difference about deprecated in Diagnostic and Semantic Token? HOT 2
- Range property in TextDocumentContentChangeEvent inconsistent with comment HOT 1
- Add 'linewidth' parameter to 'formatting_options' HOT 1
- Define/document the ways in which clients may/may not change custom-scheme URIs provided by the server
- Unclear handling of nil diagnostic responses
- When are params and error data optional?
- Command line utility for lsp client HOT 1
- Support multiple output channels for log message notifications
- Better document HOT 4
- Server capability for configuration change notifications? HOT 12
- Detailed explain on semantic token types?
- Recommend relationship between error ranges and selections for quickfixes HOT 1
- Clarification on integers and enums HOT 1
- Add "generated" to `SymbolTag`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from language-server-protocol.