If the span contains the cursor offset, push it and return `true`.
(span: mago_span::Span, offset: u32, spans: &mut Vec<(u32, u32)>)
| 107 | |
| 108 | /// If the span contains the cursor offset, push it and return `true`. |
| 109 | fn push_if_contains(span: mago_span::Span, offset: u32, spans: &mut Vec<(u32, u32)>) -> bool { |
| 110 | let start = span.start.offset; |
| 111 | let end = span.end.offset; |
| 112 | if start <= offset && offset <= end { |
| 113 | spans.push((start, end)); |
| 114 | true |
| 115 | } else { |
| 116 | false |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | /// Push a brace-delimited range (left_brace..right_brace) if it contains the cursor. |
| 121 | fn push_brace_pair( |
no test coverage detected