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-term/src/commands/typed.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'helix-term/src/commands') diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index dfc71dfd..063658c6 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -1283,7 +1283,14 @@ fn reload( doc.reload(view, &cx.editor.diff_providers, redraw_handle) .map(|_| { view.ensure_cursor_in_view(doc, scrolloff); - }) + })?; + if let Some(path) = doc.path() { + cx.editor + .language_servers + .file_event_handler + .file_changed(path.clone()); + } + Ok(()) } fn reload_all( @@ -1324,6 +1331,12 @@ fn reload_all( let redraw_handle = cx.editor.redraw_handle.clone(); doc.reload(view, &cx.editor.diff_providers, redraw_handle)?; + if let Some(path) = doc.path() { + cx.editor + .language_servers + .file_event_handler + .file_changed(path.clone()); + } for view_id in view_ids { let view = view_mut!(cx.editor, view_id); -- cgit v1.2.3-70-g09d2