aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/folding_ranges.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api/src/folding_ranges.rs')
-rw-r--r--crates/ra_ide_api/src/folding_ranges.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/ra_ide_api/src/folding_ranges.rs b/crates/ra_ide_api/src/folding_ranges.rs
index eada0b7de..6987fcc9e 100644
--- a/crates/ra_ide_api/src/folding_ranges.rs
+++ b/crates/ra_ide_api/src/folding_ranges.rs
@@ -145,7 +145,10 @@ fn contiguous_range_for_comment<'a>(
145 visited.insert(first); 145 visited.insert(first);
146 146
147 // Only fold comments of the same flavor 147 // Only fold comments of the same flavor
148 let group_flavor = first.flavor(); 148 let group_kind = first.kind();
149 if !group_kind.shape.is_line() {
150 return None;
151 }
149 152
150 let mut last = first; 153 let mut last = first;
151 for element in first.syntax().siblings_with_tokens(Direction::Next) { 154 for element in first.syntax().siblings_with_tokens(Direction::Next) {
@@ -158,7 +161,7 @@ fn contiguous_range_for_comment<'a>(
158 } 161 }
159 } 162 }
160 if let Some(c) = ast::Comment::cast(token) { 163 if let Some(c) = ast::Comment::cast(token) {
161 if c.flavor() == group_flavor { 164 if c.kind() == group_kind {
162 visited.insert(c); 165 visited.insert(c);
163 last = c; 166 last = c;
164 continue; 167 continue;