diff options
author | Blaž Hrastnik | 2021-03-12 07:20:56 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-03-12 07:25:12 +0000 |
commit | 6cbfb050e2c99acf5cdfe7d981c262fbdeaf761c (patch) | |
tree | 5fb54d50d2cb0c72e62bea9b0ca52d0dc8c70d9c /helix-view/src | |
parent | b7dd7310c44532f3e6e3154367100ee6520ca69b (diff) |
lsp: Emit didSave notifications.
Diffstat (limited to 'helix-view/src')
-rw-r--r-- | helix-view/src/document.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs index b79e201d..f394f2be 100644 --- a/helix-view/src/document.rs +++ b/helix-view/src/document.rs @@ -111,10 +111,13 @@ impl Document { let text = self.text().clone(); let path = self.path.clone().expect("Can't save with no path set!"); // TODO: handle no path + let identifier = self.identifier(); // TODO: mark changes up to now as saved // TODO: mark dirty false + let language_server = self.language_server.clone(); + async move { use smol::{fs::File, prelude::*}; let mut file = File::create(path).await?; @@ -125,8 +128,14 @@ impl Document { } // TODO: flush? + if let Some(language_server) = language_server { + language_server + .text_document_did_save(identifier, &text) + .await?; + } + Ok(()) - } // and_then notify save + } } pub fn set_language( |