diff options
Diffstat (limited to 'helix-term/src/application.rs')
-rw-r--r-- | helix-term/src/application.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index 3124beb0..fd1cfb2e 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -512,7 +512,12 @@ impl Application { use helix_core::diagnostic::{Diagnostic, Range, Severity::*}; use lsp::DiagnosticSeverity; - let language_server = doc.language_server().unwrap(); + let language_server = if let Some(language_server) = doc.language_server() { + language_server + } else { + log::warn!("Discarding diagnostic because language server is not initialized: {:?}", diagnostic); + return None; + }; // TODO: convert inside server let start = if let Some(start) = lsp_pos_to_pos( |