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.rs | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/helix-lsp/src/file_event.rs b/helix-lsp/src/file_event.rs index 5e7f8ca6..1d60f137 100644 --- a/helix-lsp/src/file_event.rs +++ b/helix-lsp/src/file_event.rs @@ -106,20 +106,22 @@ impl Handler { log::warn!("LSP client was dropped: {id}"); return false; }; - let Ok(uri) = lsp::Url::from_file_path(&path) else { - return true; - }; + let uri = lsp::Url::from_file_path(&path); log::debug!( "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 }); } |