From 16b1cfa3be2665e78bea6c876d3ced96dbfeb44f Mon Sep 17 00:00:00 2001 From: Wojciech Kępka Date: Sun, 6 Jun 2021 11:59:32 +0200 Subject: Add diagnostics keybindings --- helix-view/src/document.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'helix-view') 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, + diagnostics: Vec, language_server: Option>, } @@ -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) { + self.diagnostics = diagnostics; + } } #[cfg(test)] -- cgit v1.2.3-70-g09d2