diff options
author | Blaž Hrastnik | 2021-03-18 05:40:22 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-03-18 05:40:22 +0000 |
commit | e261f3c50d0e06860ffbeee0178381fa789dfd96 (patch) | |
tree | c9cda5cdac04fd77a89f850251d4c49af050cb45 /helix-view/src | |
parent | 5237084d98c10bbef44fcbfa9bdd13315aa9964f (diff) |
Expose doc.language_server as an accessor.
Diffstat (limited to 'helix-view/src')
-rw-r--r-- | helix-view/src/document.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs index ffbe8930..36bca5fe 100644 --- a/helix-view/src/document.rs +++ b/helix-view/src/document.rs @@ -40,7 +40,7 @@ pub struct Document { version: i32, // should be usize? pub diagnostics: Vec<Diagnostic>, - pub language_server: Option<Arc<helix_lsp::Client>>, + language_server: Option<Arc<helix_lsp::Client>>, } /// Like std::mem::replace() except it allows the replacement value to be mapped from the @@ -172,7 +172,7 @@ impl Document { self.state.selection = selection; } - pub fn _apply(&mut self, transaction: &Transaction) -> bool { + fn _apply(&mut self, transaction: &Transaction) -> bool { let old_doc = self.text().clone(); let success = transaction.apply(&mut self.state); @@ -288,6 +288,10 @@ impl Document { self.version } + pub fn language_server(&self) -> Option<&helix_lsp::Client> { + self.language_server.as_deref() + } + #[inline] pub fn path(&self) -> Option<&PathBuf> { self.path.as_ref() |