Fix the completions being too slow (#19013)

Closes https://github.com/zed-industries/zed/issues/19005

Release Notes:

- Fixed completion items inserted with a delay
([#19005](https://github.com/zed-industries/zed/issues/19005))

---------

Co-authored-by: Antonio Scandurra <antonio@zed.dev>
This commit is contained in:
Kirill Bulatov 2024-10-10 12:53:02 +03:00 committed by GitHub
parent f6f5ad138d
commit 5841ac406d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 65 additions and 145 deletions

View file

@ -363,12 +363,10 @@ mod tests {
// Confirming a completion inserts it and hides the context menu, without showing
// the copilot suggestion afterwards.
editor.confirm_completion(&Default::default(), cx).unwrap()
})
.await
.unwrap();
cx.update_editor(|editor, cx| {
editor
.confirm_completion(&Default::default(), cx)
.unwrap()
.detach();
assert!(!editor.context_menu_visible());
assert!(!editor.has_active_inline_completion(cx));
assert_eq!(editor.text(cx), "one.completion_a\ntwo\nthree\n");