Don't populate editor's context menu state if there are no completions

Max Brunsfeld created

This would accidentally stop the enter key from working.

Change summary

crates/editor/src/editor.rs | 3 +++
1 file changed, 3 insertions(+)

Detailed changes

crates/editor/src/editor.rs 🔗

@@ -1886,6 +1886,9 @@ impl Editor {
         let task = cx.spawn_weak(|this, mut cx| {
             async move {
                 let completions = completions.await?;
+                if completions.is_empty() {
+                    return Ok(());
+                }
 
                 let mut menu = CompletionsMenu {
                     id,