From 45898daf83df32ba2f79e065838e62d26a1b6e58 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Wed, 2 Feb 2022 17:09:36 -0800 Subject: [PATCH] Fix hang in editor completion unit test --- crates/editor/src/editor.rs | 12 +++++++----- crates/language/src/buffer.rs | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index d97d1f864bbea1180fa5f4f30d8ca07d503fe9d6..acb489efffbd16db24e2c8ceb00375f7d50a1174 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -6826,6 +6826,7 @@ mod tests { .with_language_server(language_server, cx) }); let buffer = cx.add_model(|cx| MultiBuffer::singleton(buffer, cx)); + buffer.next_notification(&cx).await; let (_, editor) = cx.add_window(|cx| build_editor(buffer, settings, cx)); @@ -6881,6 +6882,7 @@ mod tests { ); apply_additional_edits }); + let (id, _) = fake .receive_request::() .await; @@ -6900,11 +6902,11 @@ mod tests { assert_eq!( editor.read_with(&cx, |editor, cx| editor.text(cx)), " - one.second_completion - two - three - additional edit - " + one.second_completion + two + three + additional edit + " .unindent() ); } diff --git a/crates/language/src/buffer.rs b/crates/language/src/buffer.rs index bcc3d1c6c12c7d2a7b3dafdbd702168203e909cb..9342e956fb660a222444eb3b71ec5132688f38ba 100644 --- a/crates/language/src/buffer.rs +++ b/crates/language/src/buffer.rs @@ -746,6 +746,7 @@ impl Buffer { Operation::UpdateCompletionTriggers { triggers }, cx, ); + cx.notify(); }); } else { return;