From f1bbc776c01f88b678d693a3a3d824309e304ed1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Mon, 3 Aug 2020 15:45:39 +0300 Subject: Fold trait declarations --- crates/ra_ide/src/folding_ranges.rs | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'crates/ra_ide') diff --git a/crates/ra_ide/src/folding_ranges.rs b/crates/ra_ide/src/folding_ranges.rs index 903c34996..0fbc9babd 100644 --- a/crates/ra_ide/src/folding_ranges.rs +++ b/crates/ra_ide/src/folding_ranges.rs @@ -85,7 +85,8 @@ fn fold_kind(kind: SyntaxKind) -> Option { COMMENT => Some(FoldKind::Comment), USE => Some(FoldKind::Imports), ARG_LIST | PARAM_LIST => Some(FoldKind::ArgList), - RECORD_FIELD_LIST + ASSOC_ITEM_LIST + | RECORD_FIELD_LIST | RECORD_PAT_FIELD_LIST | RECORD_EXPR_FIELD_LIST | ITEM_LIST @@ -336,6 +337,26 @@ fn main() { ); } + #[test] + fn test_folds_structs() { + check( + r#" +struct Foo { +} +"#, + ); + } + + #[test] + fn test_folds_traits() { + check( + r#" +trait Foo { +} +"#, + ); + } + #[test] fn test_folds_macros() { check( -- cgit v1.2.3