diff options
-rw-r--r-- | crates/ide/src/folding_ranges.rs | 4 |
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, |