Ignore invalid file URIs from LSP (#6000)

pull/6016/head
Jonathan LEI 2 years ago committed by GitHub
parent c332b16855
commit 9368ac76b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -703,7 +703,13 @@ impl Application {
}
}
Notification::PublishDiagnostics(mut params) => {
let path = params.uri.to_file_path().unwrap();
let path = match params.uri.to_file_path() {
Ok(path) => path,
Err(_) => {
log::error!("Unsupported file URI: {}", params.uri);
return;
}
};
let doc = self.editor.document_by_path_mut(&path);
if let Some(doc) = doc {

Loading…
Cancel
Save