aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands
diff options
context:
space:
mode:
authorRyan Fowler2023-07-21 22:21:21 +0000
committerGitHub2023-07-21 22:21:21 +0000
commit5c41f22c2a20a1b8a91ddd6397686bd752591ffc (patch)
treef64c0dba72fb6b14a7c0f0f4c98220a25f5b2462 /helix-term/src/commands
parent8977123f25baba838d2d16f8a40e78563c4ebf4a (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-term/src/commands')
-rw-r--r--helix-term/src/commands/typed.rs15
1 files changed, 14 insertions, 1 deletions
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);