mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-25 01:34:02 +00:00
Prevent .unwrap() on Err
This commit is contained in:
parent
a94afbc062
commit
7f2514eb14
1 changed files with 4 additions and 2 deletions
|
@ -1945,8 +1945,9 @@ impl LocalLspStore {
|
|||
Some(local) => local.abs_path(cx),
|
||||
None => return,
|
||||
};
|
||||
let file_url = lsp::Url::from_file_path(old_path).unwrap();
|
||||
if let Ok(file_url) = lsp::Url::from_file_path(old_path) {
|
||||
self.unregister_buffer_from_language_servers(buffer, file_url, cx);
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn unregister_buffer_from_language_servers(
|
||||
|
@ -4919,7 +4920,7 @@ impl LspStore {
|
|||
let buffer = buffer.read(cx);
|
||||
let file = File::from_dyn(buffer.file())?;
|
||||
let abs_path = file.as_local()?.abs_path(cx);
|
||||
let uri = lsp::Url::from_file_path(abs_path).unwrap();
|
||||
if let Ok(uri) = lsp::Url::from_file_path(abs_path) {
|
||||
let next_snapshot = buffer.text_snapshot();
|
||||
|
||||
let language_servers: Vec<_> = self
|
||||
|
@ -5010,6 +5011,7 @@ impl LspStore {
|
|||
)
|
||||
.log_err();
|
||||
}
|
||||
}
|
||||
|
||||
None
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue