Do not unwrap when updating inline diagnostics (#31814)
Also do not hold the strong editor reference while debounced. Release Notes: - N/A
This commit is contained in:
parent
40c91d5df0
commit
4f1728e5ee
1 changed files with 5 additions and 6 deletions
|
@ -15703,15 +15703,14 @@ impl Editor {
|
|||
None
|
||||
};
|
||||
self.inline_diagnostics_update = cx.spawn_in(window, async move |editor, cx| {
|
||||
let editor = editor.upgrade().unwrap();
|
||||
|
||||
if let Some(debounce) = debounce {
|
||||
cx.background_executor().timer(debounce).await;
|
||||
}
|
||||
let Some(snapshot) = editor
|
||||
let Some(snapshot) = editor.upgrade().and_then(|editor| {
|
||||
editor
|
||||
.update(cx, |editor, cx| editor.buffer().read(cx).snapshot(cx))
|
||||
.ok()
|
||||
else {
|
||||
}) else {
|
||||
return;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue