Closed ebkalderon closed 6 months ago
Looks like this PR has simmered for long enough that I think it should be safe to merge!
This is not compiling for me:
Checking tower-lsp v0.20.0 (https://github.com/ebkalderon/tower-lsp?rev=49e1ce5#49e1ce54)
error[E0412]: cannot find type `WorkspaceDiagnosticRefresh` in this scope
--> /home/felix/.cargo/git/checkouts/tower-lsp-c76aca49ec8e037c/49e1ce5/src/service/client.rs:350:29
|
350 | self.send_request::<WorkspaceDiagnosticRefresh>(()).await
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
::: /home/felix/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lsp-types-0.94.1/src/workspace_diagnostic.rs:120:1
|
120 | pub struct WorkspaceDiagnosticReport {
| ------------------------------------ similarly named struct `WorkspaceDiagnosticReport` defined here
|
help: a struct with a similar name exists
|
350 | self.send_request::<WorkspaceDiagnosticReport>(()).await
| ~~~~~~~~~~~~~~~~~~~~~~~~~
help: consider importing one of these items
|
3 + use crate::request::WorkspaceDiagnosticRefresh;
|
3 + use lsp_types::request::WorkspaceDiagnosticRefresh;
|
For more information about this error, try `rustc --explain E0412`.
error: could not compile `tower-lsp` (lib) due to previous error
@Feel-ix-343 Ouch, thanks for the report! Perhaps there were breaking changes to the lsp-types
crate in the meantime while this PR was open and then last merged? Will investigate further when I have time and open a follow-up PR, if needed. In the meantime, would you mind opening an issue to track it, please? I'd really appreciate it. :smile: We can move further discussion over there.
Added
Client::progress()
builder method.Progress
andOngoingProgress
types (with bounded/unbounded & cancellable/non-cancellable type states).This pull request introduces a new API for emitting
$/progress
notifications to the client. An example might look like this:Feedback on the API and implementation is most welcome! Adapters for
Iterator
andStream
are not currently included due to previously unforeseen complexity stemming from the type state pattern.Closes #380.