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,