Add missing wait_for_anchors (#8509)

Conrad Irwin created

Release Notes:

- Fixed a panic when hovering in a collaboration session

Change summary

crates/project/src/lsp_command.rs | 7 +++++++
1 file changed, 7 insertions(+)

Detailed changes

crates/project/src/lsp_command.rs 🔗

@@ -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,