@@ -49,10 +49,8 @@ fn jump_to_location(
4949 let path = match location.uri.to_file_path() {
5050 Ok(path) => path,
5151 Err(_) => {
52− editor.set_error(format!(
53− "unable to convert URI to filepath: {}",
54− location.uri
55− ));
52+ let err = format!("unable to convert URI to filepath: {}", location.uri);
53+ editor.set_error(err);
5654 return;
5755 }
5856 };
@@ -83,19 +81,37 @@ fn sym_picker(
8381 if current_path.as_ref() == Some(&symbol.location.uri) {
8482 symbol.name.as_str().into()
8583 } else {
86− let path = symbol.location.uri.to_file_path().unwrap();
87− let relative_path = helix_core::path::get_relative_path(path.as_path())
88− .to_string_lossy()
89− .into_owned();
90− format!("{} ({})", &symbol.name, relative_path).into()
84+ match symbol.location.uri.to_file_path() {
85+ Ok(path) => {
86+ let relative_path = helix_core::path::get_relative_path(path.as_path())
87+ .to_string_lossy()
88+ .into_owned();
89+ format!("{} ({})", &symbol.name, relative_path).into()
90+ }
91+ Err(_) => format!("{} ({})", &symbol.name, &symbol.location.uri).into(),
92+ }
9193 }
9294 },
9395 move |cx, symbol, action| {
9496 if current_path2.as_ref() == Some(&symbol.location.uri) {
9597 push_jump(cx.editor);
9698 } else {
97− let path = symbol.location.uri.to_file_path().unwrap();
98− cx.editor.open(path, action).expect("editor.open failed");
99+ let uri = &symbol.location.uri;
100+ let path = match uri.to_file_path() {
101+ Ok(path) => path,
102+ Err(_) => {
103+ let err = format!("unable to convert URI to filepath: {}", uri);
104+ log::error!("{}", err);
105+ cx.editor.set_error(err);
106+ return;
107+ }
108+ };
109+ if let Err(err) = cx.editor.open(path, action) {
110+ let err = format!("failed to open document: {}: {}", uri, err);
111+ log::error!("{}", err);
112+ cx.editor.set_error(err);
113+ return;
114+ }
99115 }
100116
101117 let (view, doc) = current!(cx.editor);
@@ -361,7 +377,16 @@ pub fn apply_workspace_edit(
361377 };
362378
363379 let current_view_id = view!(editor).id;
364− let doc_id = editor.open(path, Action::Load).unwrap();
380+ let doc_id = match editor.open(path, Action::Load) {
381+ Ok(doc_id) => doc_id,
382+ Err(err) => {
383+ let err = format!("failed to open document: {}: {}", uri, err);
384+ log::error!("{}", err);
385+ editor.set_error(err);
386+ return;
387+ }
388+ };
389+
365390 let doc = editor
366391 .document_mut(doc_id)
367392 .expect("Document for document_changes not found");