Add missing wait_for_anchors (#8509)

Release Notes:

- Fixed a panic when hovering in a collaboration session
This commit is contained in:
Conrad Irwin 2024-02-27 16:04:30 -07:00 committed by GitHub
parent 9765260567
commit d545fe9fe4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1405,6 +1405,13 @@ impl LspCommand for GetHover {
} else {
None
};
if let Some(range) = range.as_ref() {
buffer
.update(&mut cx, |buffer, _| {
buffer.wait_for_anchors([range.start.clone(), range.end.clone()])
})?
.await?;
}
Ok(Some(Hover {
contents,