From 71f1c4470df974e10e18cab6da401a0a78feafc2 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Thu, 16 Jan 2025 10:56:57 +0100 Subject: [PATCH] Add edit test for await skipping completions --- crates/ide-completion/src/completions/dot.rs | 28 ++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/crates/ide-completion/src/completions/dot.rs b/crates/ide-completion/src/completions/dot.rs index 3a991e007a..4031097034 100644 --- a/crates/ide-completion/src/completions/dot.rs +++ b/crates/ide-completion/src/completions/dot.rs @@ -1437,5 +1437,33 @@ async fn bar() { me into_future() (use core::future::IntoFuture) fn(self) -> ::IntoFuture "#]], ); + check_edit( + "foo", + r#" +//- minicore: future +struct Foo; +impl Foo { + fn foo(self) {} +} + +async fn foo() -> Foo { Foo } + +async fn bar() { + foo().$0 +} +"#, + r#" +struct Foo; +impl Foo { + fn foo(self) {} +} + +async fn foo() -> Foo { Foo } + +async fn bar() { + foo().await.foo();$0 +} +"#, + ); } }