aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/folding_ranges.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-07-20 10:58:27 +0100
committerAleksey Kladov <[email protected]>2019-07-20 10:58:27 +0100
commitf3bdbec1b68fa0e20f0b7b6c6ef64e1507970b0d (patch)
treef2cb82f74d2d60d5351c3d7c4d8e7bce4d351cab /crates/ra_ide_api/src/folding_ranges.rs
parent6d5d82e412dea19ea48eecc6f7d5a4aa223a9599 (diff)
rename range -> text_range
Diffstat (limited to 'crates/ra_ide_api/src/folding_ranges.rs')
-rw-r--r--crates/ra_ide_api/src/folding_ranges.rs9
1 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 c2b981aed..9699000db 100644
--- a/crates/ra_ide_api/src/folding_ranges.rs
+++ b/crates/ra_ide_api/src/folding_ranges.rs
@@ -35,7 +35,7 @@ pub(crate) fn folding_ranges(file: &SourceFile) -> Vec<Fold> {
35 SyntaxElement::Token(token) => token.text().contains('\n'), 35 SyntaxElement::Token(token) => token.text().contains('\n'),
36 }; 36 };
37 if is_multiline { 37 if is_multiline {
38 res.push(Fold { range: element.range(), kind }); 38 res.push(Fold { range: element.text_range(), kind });
39 continue; 39 continue;
40 } 40 }
41 } 41 }
@@ -132,7 +132,7 @@ fn contiguous_range_for_group_unless(
132 } 132 }
133 133
134 if first != &last { 134 if first != &last {
135 Some(TextRange::from_to(first.range().start(), last.range().end())) 135 Some(TextRange::from_to(first.text_range().start(), last.text_range().end()))
136 } else { 136 } else {
137 // The group consists of only one element, therefore it cannot be folded 137 // The group consists of only one element, therefore it cannot be folded
138 None 138 None
@@ -178,7 +178,10 @@ fn contiguous_range_for_comment(
178 } 178 }
179 179
180 if first != last { 180 if first != last {
181 Some(TextRange::from_to(first.syntax().range().start(), last.syntax().range().end())) 181 Some(TextRange::from_to(
182 first.syntax().text_range().start(),
183 last.syntax().text_range().end(),
184 ))
182 } else { 185 } else {
183 // The group consists of only one element, therefore it cannot be folded 186 // The group consists of only one element, therefore it cannot be folded
184 None 187 None