mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-31 21:47:15 +03:00
Enable ADT keyword completions in block expression
This commit is contained in:
@@ -86,7 +86,7 @@ pub(crate) fn complete_expr_keyword(acc: &mut Completions, ctx: &CompletionConte
|
||||
add_keyword("mod", "mod $0");
|
||||
}
|
||||
|
||||
if expects_item {
|
||||
if expects_item || has_block_expr_parent {
|
||||
add_keyword("enum", "enum $1 {\n $0\n}");
|
||||
add_keyword("struct", "struct $0");
|
||||
add_keyword("union", "union $1 {\n $0\n}");
|
||||
|
||||
@@ -137,6 +137,9 @@ fn local_func() {}
|
||||
kw trait
|
||||
kw static
|
||||
kw mod
|
||||
kw enum
|
||||
kw struct
|
||||
kw union
|
||||
kw match
|
||||
kw while
|
||||
kw while let
|
||||
@@ -227,6 +230,9 @@ fn foo() {
|
||||
kw trait
|
||||
kw static
|
||||
kw mod
|
||||
kw enum
|
||||
kw struct
|
||||
kw union
|
||||
kw match
|
||||
kw while
|
||||
kw while let
|
||||
@@ -269,6 +275,9 @@ fn foo() {
|
||||
kw trait
|
||||
kw static
|
||||
kw mod
|
||||
kw enum
|
||||
kw struct
|
||||
kw union
|
||||
kw match
|
||||
kw while
|
||||
kw while let
|
||||
@@ -339,6 +348,9 @@ fn completes_in_loop_ctx() {
|
||||
kw trait
|
||||
kw static
|
||||
kw mod
|
||||
kw enum
|
||||
kw struct
|
||||
kw union
|
||||
kw match
|
||||
kw while
|
||||
kw while let
|
||||
|
||||
Reference in New Issue
Block a user