diff options
-rw-r--r-- | crates/ide/src/folding_ranges.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/ide/src/folding_ranges.rs b/crates/ide/src/folding_ranges.rs index 8f3144de0..8b8a2cc38 100644 --- a/crates/ide/src/folding_ranges.rs +++ b/crates/ide/src/folding_ranges.rs | |||
@@ -33,6 +33,7 @@ pub(crate) fn folding_ranges(file: &SourceFile) -> Vec<Fold> { | |||
33 | let mut visited_imports = FxHashSet::default(); | 33 | let mut visited_imports = FxHashSet::default(); |
34 | let mut visited_mods = FxHashSet::default(); | 34 | let mut visited_mods = FxHashSet::default(); |
35 | let mut visited_consts = FxHashSet::default(); | 35 | let mut visited_consts = FxHashSet::default(); |
36 | let mut visited_statics = FxHashSet::default(); | ||
36 | // regions can be nested, here is a LIFO buffer | 37 | // regions can be nested, here is a LIFO buffer |
37 | let mut regions_starts: Vec<TextSize> = vec![]; | 38 | let mut regions_starts: Vec<TextSize> = vec![]; |
38 | 39 | ||
@@ -101,6 +102,12 @@ pub(crate) fn folding_ranges(file: &SourceFile) -> Vec<Fold> { | |||
101 | res.push(Fold { range, kind: FoldKind::Consts }) | 102 | res.push(Fold { range, kind: FoldKind::Consts }) |
102 | } | 103 | } |
103 | } | 104 | } |
105 | // Fold groups of consts | ||
106 | if node.kind() == STATIC && !visited_statics.contains(&node) { | ||
107 | if let Some(range) = contiguous_range_for_group(&node, &mut visited_statics) { | ||
108 | res.push(Fold { range, kind: FoldKind::Statics }) | ||
109 | } | ||
110 | } | ||
104 | } | 111 | } |
105 | } | 112 | } |
106 | } | 113 | } |