aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuciano <[email protected]>2021-02-13 16:46:26 +0000
committerGitHub <[email protected]>2021-02-13 16:46:26 +0000
commit75015b6eaaad6cb6ce511cff2f3f1e5e34450106 (patch)
treeb7aa858ed5377d6ff9392d2be48864275491f3c8
parent084b21bc36cd624e8db708eb1e12dd6db99a0602 (diff)
Update crates/ide/src/folding_ranges.rs
Co-authored-by: Lukas Wirth <[email protected]>
-rw-r--r--crates/ide/src/folding_ranges.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ide/src/folding_ranges.rs b/crates/ide/src/folding_ranges.rs
index 7ba775a77..531f3c951 100644
--- a/crates/ide/src/folding_ranges.rs
+++ b/crates/ide/src/folding_ranges.rs
@@ -55,10 +55,10 @@ pub(crate) fn folding_ranges(file: &SourceFile) -> Vec<Fold> {
55 if comment.text().trim().starts_with("// region:") { 55 if comment.text().trim().starts_with("// region:") {
56 regions_starts.push(comment.syntax().text_range().start()); 56 regions_starts.push(comment.syntax().text_range().start());
57 } else if comment.text().trim().starts_with("// endregion") { 57 } else if comment.text().trim().starts_with("// endregion") {
58 if !regions_starts.is_empty() { 58 if let Some(region) = regions_starts.pop() {
59 res.push(Fold { 59 res.push(Fold {
60 range: TextRange::new( 60 range: TextRange::new(
61 regions_starts.pop().unwrap(), 61 region,
62 comment.syntax().text_range().end(), 62 comment.syntax().text_range().end(),
63 ), 63 ),
64 kind: FoldKind::Region, 64 kind: FoldKind::Region,