From 9368ac76b36f430cd127658d9e66b169053c9626 Mon Sep 17 00:00:00 2001 From: Jonathan LEI Date: Thu, 16 Feb 2023 13:17:18 +0800 Subject: [PATCH] Ignore invalid file URIs from LSP (#6000) --- helix-term/src/application.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index a1685fcfa..c8e8ecb1a 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -703,7 +703,13 @@ impl Application { } } Notification::PublishDiagnostics(mut params) => { - let path = params.uri.to_file_path().unwrap(); + let path = match params.uri.to_file_path() { + Ok(path) => path, + Err(_) => { + log::error!("Unsupported file URI: {}", params.uri); + return; + } + }; let doc = self.editor.document_by_path_mut(&path); if let Some(doc) = doc {