mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-27 20:35:09 +00:00
Merge #5284
5284: Fold struct literals r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
1fb92d791e
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),
|
ARG_LIST => Some(FoldKind::ArgList),
|
||||||
RECORD_FIELD_DEF_LIST
|
RECORD_FIELD_DEF_LIST
|
||||||
| RECORD_FIELD_PAT_LIST
|
| RECORD_FIELD_PAT_LIST
|
||||||
|
| RECORD_FIELD_LIST
|
||||||
| ITEM_LIST
|
| ITEM_LIST
|
||||||
| EXTERN_ITEM_LIST
|
| EXTERN_ITEM_LIST
|
||||||
| USE_TREE_LIST
|
| USE_TREE_LIST
|
||||||
|
@ -355,7 +356,8 @@ fn main() <fold block>{
|
||||||
0 => 0,
|
0 => 0,
|
||||||
_ => 1,
|
_ => 1,
|
||||||
}</fold>
|
}</fold>
|
||||||
}</fold>"#,
|
}</fold>
|
||||||
|
"#,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -370,7 +372,18 @@ fn main() <fold block>{
|
||||||
3,
|
3,
|
||||||
)</fold>
|
)</fold>
|
||||||
}</fold>
|
}</fold>
|
||||||
"#,
|
"#,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn fold_record_literals() {
|
||||||
|
check(
|
||||||
|
r#"
|
||||||
|
const _: S = S <fold block>{
|
||||||
|
|
||||||
|
}</fold>;
|
||||||
|
"#,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue