File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ pub(crate) fn folding_ranges(file: &SourceFile) -> Vec<Fold> {
33
33
let mut visited_imports = FxHashSet :: default ( ) ;
34
34
let mut visited_mods = FxHashSet :: default ( ) ;
35
35
let mut visited_consts = FxHashSet :: default ( ) ;
36
+ let mut visited_statics = FxHashSet :: default ( ) ;
36
37
// regions can be nested, here is a LIFO buffer
37
38
let mut regions_starts: Vec < TextSize > = vec ! [ ] ;
38
39
@@ -101,6 +102,12 @@ pub(crate) fn folding_ranges(file: &SourceFile) -> Vec<Fold> {
101
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
}
You can’t perform that action at this time.
0 commit comments