mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-25 04:23:25 +00:00
Merge #5653
5653: Fold trait declarations r=SomeoneToIgnore a=lnicola Fixes #5652 Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
This commit is contained in:
commit
33e53d4721
1 changed files with 22 additions and 1 deletions
|
@ -85,7 +85,8 @@ fn fold_kind(kind: SyntaxKind) -> Option<FoldKind> {
|
||||||
COMMENT => Some(FoldKind::Comment),
|
COMMENT => Some(FoldKind::Comment),
|
||||||
USE => Some(FoldKind::Imports),
|
USE => Some(FoldKind::Imports),
|
||||||
ARG_LIST | PARAM_LIST => Some(FoldKind::ArgList),
|
ARG_LIST | PARAM_LIST => Some(FoldKind::ArgList),
|
||||||
RECORD_FIELD_LIST
|
ASSOC_ITEM_LIST
|
||||||
|
| RECORD_FIELD_LIST
|
||||||
| RECORD_PAT_FIELD_LIST
|
| RECORD_PAT_FIELD_LIST
|
||||||
| RECORD_EXPR_FIELD_LIST
|
| RECORD_EXPR_FIELD_LIST
|
||||||
| ITEM_LIST
|
| ITEM_LIST
|
||||||
|
@ -336,6 +337,26 @@ fn main() <fold block>{
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_folds_structs() {
|
||||||
|
check(
|
||||||
|
r#"
|
||||||
|
struct Foo <fold block>{
|
||||||
|
}</fold>
|
||||||
|
"#,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_folds_traits() {
|
||||||
|
check(
|
||||||
|
r#"
|
||||||
|
trait Foo <fold block>{
|
||||||
|
}</fold>
|
||||||
|
"#,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_folds_macros() {
|
fn test_folds_macros() {
|
||||||
check(
|
check(
|
||||||
|
|
Loading…
Reference in a new issue