diff options
author | Ryan Fowler | 2023-07-21 22:21:21 +0000 |
---|---|---|
committer | GitHub | 2023-07-21 22:21:21 +0000 |
commit | 5c41f22c2a20a1b8a91ddd6397686bd752591ffc (patch) | |
tree | f64c0dba72fb6b14a7c0f0f4c98220a25f5b2462 /helix-lsp/src/client.rs | |
parent | 8977123f25baba838d2d16f8a40e78563c4ebf4a (diff) |
Add support for LSP DidChangeWatchedFiles (#7665)
* Add initial support for LSP DidChangeWatchedFiles
* Move file event Handler to helix-lsp
* Simplify file event handling
* Refactor file event handling
* Block on future within LSP file event handler
* Fully qualify uses of the file_event::Handler type
* Rename ops field to options
* Revert newline removal from helix-view/Cargo.toml
* Ensure file event Handler is cleaned up when lsp client is shutdown
Diffstat (limited to 'helix-lsp/src/client.rs')
-rw-r--r-- | helix-lsp/src/client.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/helix-lsp/src/client.rs b/helix-lsp/src/client.rs index 92ab03db..ed9a2f83 100644 --- a/helix-lsp/src/client.rs +++ b/helix-lsp/src/client.rs @@ -544,6 +544,10 @@ impl Client { normalizes_line_endings: Some(false), change_annotation_support: None, }), + did_change_watched_files: Some(lsp::DidChangeWatchedFilesClientCapabilities { + dynamic_registration: Some(true), + relative_pattern_support: Some(false), + }), ..Default::default() }), text_document: Some(lsp::TextDocumentClientCapabilities { @@ -1453,4 +1457,13 @@ impl Client { Some(self.call::<lsp::request::ExecuteCommand>(params)) } + + pub fn did_change_watched_files( + &self, + changes: Vec<lsp::FileEvent>, + ) -> impl Future<Output = std::result::Result<(), Error>> { + self.notify::<lsp::notification::DidChangeWatchedFiles>(lsp::DidChangeWatchedFilesParams { + changes, + }) + } } |