-
I have read the corresponding page explaining how progress reporting work. Among other things it says:
and
After reading this, I was under the impression that it's a matter of configuration, and one can set it up to work with LSP names for those tokens, namely After not finding anything of the sort in the API, I looked into the code and the tests, and it seems that current implementations, which are all derived from Implementing a whole |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
You're mixing up the client vs. server-side docs. The parts of the doc you quote from is from the client section. The client (an LSP client in your case) can make any argument a special progress argument, without regard to position (in the case of positional arguments in the JSON-RPC request) or name (in the case of named arguments). Although it is expected to match whatever the signature of the method on the server specifies.
I'll grant you this is poorly worded, since it assumes But this is intended to mean that the client gets to make up the value of the token that the server will use to provide progress updates. StreamJsonRpc already works with LSP as-is. No need to implement If you're designing the method to be invoked, and using StreamJsonRpc to implement it, then just add an If you're writing the client code that calls it, with StreamJsonRpc, just invoke the method, passing in an |
Beta Was this translation helpful? Give feedback.
You appear to be mixing things up with your
UseSingleObjectParameterDeserialization = true
setting. This works when the server method takes exactly one parameter. Yours takes two:(Data d, IProgress<WorkDoneProgress> pi)
.Your client is sending a message that expects the server to define a method that takes two parameters named
Prop
andWorkDoneToken
. Because your server method setsUseSingleObjectParameterDeserialization = true
, the server will apply the typical LSP-deviation from the JSON-RPC spec and consider those named arguments to instead be properties on an object that is passed to the only parameter on the server method. But you have two parameters on it. Thepi
parameter does no…