From 251ef93ac3bbb138a2eedf6090f2f56f1a15d898 Mon Sep 17 00:00:00 2001 From: oxalica Date: Thu, 10 Sep 2020 20:01:23 +0800 Subject: Implement async blocks --- crates/ide/src/completion/complete_keyword.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'crates/ide/src/completion/complete_keyword.rs') diff --git a/crates/ide/src/completion/complete_keyword.rs b/crates/ide/src/completion/complete_keyword.rs index 53ba76e0e..5645b41fa 100644 --- a/crates/ide/src/completion/complete_keyword.rs +++ b/crates/ide/src/completion/complete_keyword.rs @@ -506,6 +506,28 @@ pub mod future { #[lang = "future_trait"] pub trait Future {} } +"#, + expect![[r#" + kw await expr.await + "#]], + ); + + check( + r#" +//- /main.rs +use std::future::*; +fn foo() { + let a = async {}; + a.<|> +} + +//- /std/lib.rs +pub mod future { + #[lang = "future_trait"] + pub trait Future { + type Output; + } +} "#, expect![[r#" kw await expr.await -- cgit v1.2.3