diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index 47744d00b5c7..c9ecb03d00a8 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -750,7 +750,12 @@ impl Application { return; } }; - let offset_encoding = language_server!().offset_encoding(); + let language_server = language_server!(); + if !language_server.is_initialized() { + log::error!("Discarding publishDiagnostic notification sent by an uninitialized server: {}", language_server.name()); + return; + } + let offset_encoding = language_server.offset_encoding(); let doc = self.editor.document_by_path_mut(&path).filter(|doc| { if let Some(version) = params.version { if version != doc.version() {