Skip to content

Commit 9368ac7

Browse files
authored
Ignore invalid file URIs from LSP (#6000)
1 parent c332b16 commit 9368ac7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

helix-term/src/application.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,13 @@ impl Application {
703703
}
704704
}
705705
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+
};
707713
let doc = self.editor.document_by_path_mut(&path);
708714

709715
if let Some(doc) = doc {

0 commit comments

Comments
 (0)