aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api')
-rw-r--r--crates/ra_ide_api/src/folding_ranges.rs7
-rw-r--r--crates/ra_ide_api/src/typing.rs2
2 files changed, 6 insertions, 3 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;
diff --git a/crates/ra_ide_api/src/typing.rs b/crates/ra_ide_api/src/typing.rs
index aeeeea082..ae53bca77 100644
--- a/crates/ra_ide_api/src/typing.rs
+++ b/crates/ra_ide_api/src/typing.rs
@@ -15,7 +15,7 @@ pub(crate) fn on_enter(db: &RootDatabase, position: FilePosition) -> Option<Sour
15 .left_biased() 15 .left_biased()
16 .and_then(ast::Comment::cast)?; 16 .and_then(ast::Comment::cast)?;
17 17
18 if comment.flavor() == ast::CommentFlavor::Multiline { 18 if comment.kind().shape.is_block() {
19 return None; 19 return None;
20 } 20 }
21 21