From 5c41f22c2a20a1b8a91ddd6397686bd752591ffc Mon Sep 17 00:00:00 2001 From: Ryan Fowler Date: Fri, 21 Jul 2023 15:21:21 -0700 Subject: 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--- helix-lsp/src/client.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'helix-lsp/src/client.rs') 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::(params)) } + + pub fn did_change_watched_files( + &self, + changes: Vec, + ) -> impl Future> { + self.notify::(lsp::DidChangeWatchedFilesParams { + changes, + }) + } } -- cgit v1.2.3-70-g09d2