-
Notifications
You must be signed in to change notification settings - Fork 280
impl Support LSP $/progress messages #422 #2591
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -201,3 +201,38 @@ where | |||||||||||
| (self.publish_callback)(transaction, handle, exports_changed); | ||||||||||||
| } | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| /// A subscriber that forwards all events to each of its inner subscribers. | ||||||||||||
| pub struct CompositeSubscriber<'a> { | ||||||||||||
| subscribers: Vec<Box<dyn Subscriber + 'a>>, | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| impl<'a> CompositeSubscriber<'a> { | ||||||||||||
| pub fn new(subscribers: Vec<Box<dyn Subscriber + 'a>>) -> Self { | ||||||||||||
| assert!( | ||||||||||||
| !subscribers.is_empty(), | ||||||||||||
| "CompositeSubscriber requires at least one subscriber" | ||||||||||||
| ); | ||||||||||||
|
Comment on lines
+212
to
+215
|
||||||||||||
| assert!( | |
| !subscribers.is_empty(), | |
| "CompositeSubscriber requires at least one subscriber" | |
| ); | |
| // Allow an empty subscriber list; this results in a no-op composite subscriber. |
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.
window/workDoneProgress/createis sent, but the server may start emitting$/progressnotifications immediately (on the firststart_work) without waiting for the create request to be acknowledged. Per LSP, clients may ignore progress updates until the token is created. Consider tracking the create request/response (e.g., store the request id/token inServer, mark it ready on the matching response, and haveLspProgressSubscribersuppress Begin/Report until ready) soBegincannot be sent before the create response.