mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 04:53:34 +00:00
Fold struct literals
This commit is contained in:
parent
f1d084fbd9
commit
ca8969a104
1 changed files with 15 additions and 2 deletions
|
@ -87,6 +87,7 @@ fn fold_kind(kind: SyntaxKind) -> Option<FoldKind> {
|
|||
ARG_LIST => Some(FoldKind::ArgList),
|
||||
RECORD_FIELD_DEF_LIST
|
||||
| RECORD_FIELD_PAT_LIST
|
||||
| RECORD_FIELD_LIST
|
||||
| ITEM_LIST
|
||||
| EXTERN_ITEM_LIST
|
||||
| USE_TREE_LIST
|
||||
|
@ -355,7 +356,8 @@ fn main() <fold block>{
|
|||
0 => 0,
|
||||
_ => 1,
|
||||
}</fold>
|
||||
}</fold>"#,
|
||||
}</fold>
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -370,7 +372,18 @@ fn main() <fold block>{
|
|||
3,
|
||||
)</fold>
|
||||
}</fold>
|
||||
"#,
|
||||
"#,
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn fold_record_literals() {
|
||||
check(
|
||||
r#"
|
||||
const _: S = S <fold block>{
|
||||
|
||||
}</fold>;
|
||||
"#,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue