on master help sign in
Ignore invalid file URIs from LSP (#6000)
9368ac7Jonathan LEI
helix-term/src/application.rs+7−1
@@ -703,7 +703,13 @@ impl Application {
703 }
703 }
704 }
704 }
705 Notification::PublishDiagnostics(mut params) => {
705 Notification::PublishDiagnostics(mut params) => {
706− let path = params.uri.to_file_path().unwrap();
706+ let path = match params.uri.to_file_path() {
707+ Ok(path) => path,
708+ Err(_) => {
709+ log::error!("Unsupported file URI: {}", params.uri);
710+ return;
711+ }
712+ };
707 let doc = self.editor.document_by_path_mut(&path);
713 let doc = self.editor.document_by_path_mut(&path);
708
714
709 if let Some(doc) = doc {
715 if let Some(doc) = doc {