aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src/document.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-view/src/document.rs')
-rw-r--r--helix-view/src/document.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs
index 9093dbe8..783e1117 100644
--- a/helix-view/src/document.rs
+++ b/helix-view/src/document.rs
@@ -48,7 +48,7 @@ pub struct Document {
last_saved_revision: usize,
version: i32, // should be usize?
- pub diagnostics: Vec<Diagnostic>,
+ diagnostics: Vec<Diagnostic>,
language_server: Option<Arc<helix_lsp::Client>>,
}
@@ -519,6 +519,14 @@ impl Document {
pub fn versioned_identifier(&self) -> lsp::VersionedTextDocumentIdentifier {
lsp::VersionedTextDocumentIdentifier::new(self.url().unwrap(), self.version)
}
+
+ pub fn diagnostics(&self) -> &[Diagnostic] {
+ &self.diagnostics
+ }
+
+ pub fn set_diagnostics(&mut self, diagnostics: Vec<Diagnostic>) {
+ self.diagnostics = diagnostics;
+ }
}
#[cfg(test)]