From 34d6d29fc27e7a0de4d3239776bf1efafb9cfe9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Buga?= Date: Fri, 25 Mar 2022 20:45:40 +0100 Subject: [PATCH] Print problematic path --- lapce-proxy/src/lsp.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lapce-proxy/src/lsp.rs b/lapce-proxy/src/lsp.rs index fdb28bcd..1b0717cb 100644 --- a/lapce-proxy/src/lsp.rs +++ b/lapce-proxy/src/lsp.rs @@ -430,7 +430,10 @@ pub fn get_uri(&self, buffer: &Buffer) -> Url { state.opened_documents.contains_key(&buffer.id) }; if !exits { - let document_uri = Url::from_file_path(&buffer.path).unwrap(); + let document_uri = + Url::from_file_path(&buffer.path).unwrap_or_else(|_| { + panic!("Failed to create URL from path {:?}", buffer.path) + }); self.send_did_open( &buffer.id, document_uri,