mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 11:31:15 +00:00
Auto merge of #11993 - jonas-schievink:adt-completions-in-block, r=jonas-schievink
fix: enable ADT keyword completions in block expressions fixes https://github.com/rust-lang/rust-analyzer/issues/11576
This commit is contained in:
commit
7ce3ca5aab
@ -86,7 +86,7 @@ pub(crate) fn complete_expr_keyword(acc: &mut Completions, ctx: &CompletionConte
|
|||||||
add_keyword("mod", "mod $0");
|
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("enum", "enum $1 {\n $0\n}");
|
||||||
add_keyword("struct", "struct $0");
|
add_keyword("struct", "struct $0");
|
||||||
add_keyword("union", "union $1 {\n $0\n}");
|
add_keyword("union", "union $1 {\n $0\n}");
|
||||||
|
@ -137,6 +137,9 @@ impl Unit {
|
|||||||
kw trait
|
kw trait
|
||||||
kw static
|
kw static
|
||||||
kw mod
|
kw mod
|
||||||
|
kw enum
|
||||||
|
kw struct
|
||||||
|
kw union
|
||||||
kw match
|
kw match
|
||||||
kw while
|
kw while
|
||||||
kw while let
|
kw while let
|
||||||
@ -227,6 +230,9 @@ fn complete_in_block() {
|
|||||||
kw trait
|
kw trait
|
||||||
kw static
|
kw static
|
||||||
kw mod
|
kw mod
|
||||||
|
kw enum
|
||||||
|
kw struct
|
||||||
|
kw union
|
||||||
kw match
|
kw match
|
||||||
kw while
|
kw while
|
||||||
kw while let
|
kw while let
|
||||||
@ -269,6 +275,9 @@ fn complete_after_if_expr() {
|
|||||||
kw trait
|
kw trait
|
||||||
kw static
|
kw static
|
||||||
kw mod
|
kw mod
|
||||||
|
kw enum
|
||||||
|
kw struct
|
||||||
|
kw union
|
||||||
kw match
|
kw match
|
||||||
kw while
|
kw while
|
||||||
kw while let
|
kw while let
|
||||||
@ -339,6 +348,9 @@ fn completes_in_loop_ctx() {
|
|||||||
kw trait
|
kw trait
|
||||||
kw static
|
kw static
|
||||||
kw mod
|
kw mod
|
||||||
|
kw enum
|
||||||
|
kw struct
|
||||||
|
kw union
|
||||||
kw match
|
kw match
|
||||||
kw while
|
kw while
|
||||||
kw while let
|
kw while let
|
||||||
|
Loading…
x
Reference in New Issue
Block a user