Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-lsp/src/file_event.rs')
-rw-r--r--helix-lsp/src/file_event.rs20
1 files changed, 12 insertions, 8 deletions
diff --git a/helix-lsp/src/file_event.rs b/helix-lsp/src/file_event.rs
index 5e7f8ca6..8f4c1675 100644
--- a/helix-lsp/src/file_event.rs
+++ b/helix-lsp/src/file_event.rs
@@ -113,13 +113,17 @@ impl Handler {
"Sending didChangeWatchedFiles notification to client '{}'",
client.name()
);
- client.did_change_watched_files(vec![lsp::FileEvent {
- uri,
- // We currently always send the CHANGED state
- // since we don't actually have more context at
- // the moment.
- typ: lsp::FileChangeType::CHANGED,
- }]);
+ if let Err(err) = crate::block_on(client
+ .did_change_watched_files(vec![lsp::FileEvent {
+ uri,
+ // We currently always send the CHANGED state
+ // since we don't actually have more context at
+ // the moment.
+ typ: lsp::FileChangeType::CHANGED,
+ }]))
+ {
+ log::warn!("Failed to send didChangeWatchedFiles notification to client: {err}");
+ }
true
});
}
@@ -135,7 +139,7 @@ impl Handler {
registration_id
);
- let entry = state.entry(client_id).or_default();
+ let entry = state.entry(client_id).or_insert_with(ClientState::default);
entry.client = client;
let mut builder = GlobSetBuilder::new();