MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / push_if_contains

Function push_if_contains

src/selection_range.rs:109–118  ·  view source on GitHub ↗

If the span contains the cursor offset, push it and return `true`.

(span: mago_span::Span, offset: u32, spans: &mut Vec<(u32, u32)>)

Source from the content-addressed store, hash-verified

107
108/// If the span contains the cursor offset, push it and return `true`.
109fn 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.
121fn push_brace_pair(

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected