Skip to content

Commit

Permalink
fix(completion): complete async keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
MariaSolOs committed Jun 19, 2024
1 parent c1fed6a commit b4952b2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ fn add_keywords(acc: &mut Completions, ctx: &CompletionContext<'_>, kind: Option
add_keyword("enum", "enum $1 {\n $0\n}");
add_keyword("mod", "mod $0");
add_keyword("static", "static $0");
add_keyword("async", "async $0");
add_keyword("struct", "struct $0");
add_keyword("trait", "trait $1 {\n $0\n}");
add_keyword("union", "union $1 {\n $0\n}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ impl Unit {
un Union Union
ev TupleV(…) TupleV(u32)
bt u32 u32
kw async
kw const
kw crate::
kw enum
Expand Down Expand Up @@ -217,6 +218,7 @@ fn complete_in_block() {
expect![[r#"
fn foo() fn()
bt u32 u32
kw async
kw const
kw crate::
kw enum
Expand Down Expand Up @@ -264,6 +266,7 @@ fn complete_after_if_expr() {
expect![[r#"
fn foo() fn()
bt u32 u32
kw async
kw const
kw crate::
kw else
Expand Down Expand Up @@ -336,6 +339,7 @@ fn completes_in_loop_ctx() {
expect![[r#"
fn my() fn()
bt u32 u32
kw async
kw break
kw const
kw continue
Expand Down Expand Up @@ -799,6 +803,7 @@ fn foo() { if foo {} $0 }
expect![[r#"
fn foo() fn()
bt u32 u32
kw async
kw const
kw crate::
kw else
Expand Down Expand Up @@ -839,6 +844,7 @@ fn foo() { if foo {} el$0 }
expect![[r#"
fn foo() fn()
bt u32 u32
kw async
kw const
kw crate::
kw else
Expand Down Expand Up @@ -927,6 +933,7 @@ fn foo() { if foo {} $0 let x = 92; }
expect![[r#"
fn foo() fn()
bt u32 u32
kw async
kw const
kw crate::
kw else
Expand Down Expand Up @@ -967,6 +974,7 @@ fn foo() { if foo {} el$0 let x = 92; }
expect![[r#"
fn foo() fn()
bt u32 u32
kw async
kw const
kw crate::
kw else
Expand Down Expand Up @@ -1007,6 +1015,7 @@ fn foo() { if foo {} el$0 { let x = 92; } }
expect![[r#"
fn foo() fn()
bt u32 u32
kw async
kw const
kw crate::
kw else
Expand Down Expand Up @@ -1059,6 +1068,7 @@ pub struct UnstableThisShouldNotBeListed;
fn main() fn()
md std
bt u32 u32
kw async
kw const
kw crate::
kw enum
Expand Down Expand Up @@ -1111,6 +1121,7 @@ pub struct UnstableButWeAreOnNightlyAnyway;
md std
st UnstableButWeAreOnNightlyAnyway UnstableButWeAreOnNightlyAnyway
bt u32 u32
kw async
kw const
kw crate::
kw enum
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ fn in_mod_item_list() {
r#"mod tests { $0 }"#,
expect![[r#"
ma makro!(…) macro_rules! makro
kw async
kw const
kw crate::
kw enum
Expand Down Expand Up @@ -47,6 +48,7 @@ fn in_source_file_item_list() {
expect![[r#"
ma makro!(…) macro_rules! makro
md module
kw async
kw const
kw crate::
kw enum
Expand Down Expand Up @@ -79,6 +81,7 @@ fn in_item_list_after_attr() {
expect![[r#"
ma makro!(…) macro_rules! makro
md module
kw async
kw const
kw crate::
kw enum
Expand Down Expand Up @@ -132,6 +135,7 @@ fn after_visibility() {
check(
r#"pub $0"#,
expect![[r#"
kw async
kw const
kw enum
kw extern
Expand Down Expand Up @@ -356,6 +360,7 @@ fn after_unit_struct() {
expect![[r#"
ma makro!(…) macro_rules! makro
md module
kw async
kw const
kw crate::
kw enum
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,7 @@ fn here_we_go() {
fn here_we_go() fn()
st Foo (alias Bar) Foo
bt u32 u32
kw async
kw const
kw crate::
kw enum
Expand Down Expand Up @@ -1066,6 +1067,7 @@ fn here_we_go() {
fn here_we_go() fn()
st Foo (alias Bar, Qux, Baz) Foo
bt u32 u32
kw async
kw const
kw crate::
kw enum
Expand Down Expand Up @@ -1188,6 +1190,7 @@ fn bar() { qu$0 }
fn bar() fn()
fn foo() (alias qux) fn()
bt u32 u32
kw async
kw const
kw crate::
kw enum
Expand Down Expand Up @@ -1443,6 +1446,7 @@ fn foo() {
expect![[r#"
fn foo() fn()
bt u32 u32
kw async
kw const
kw crate::
kw enum
Expand Down

0 comments on commit b4952b2

Please sign in to comment.