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

Function assert_nested

src/selection_range.rs:1086–1102  ·  view source on GitHub ↗

Helper: assert every range in the chain is contained within its parent.

(ranges: &[Range])

Source from the content-addressed store, hash-verified

1084
1085 /// Helper: assert every range in the chain is contained within its parent.
1086 fn assert_nested(ranges: &[Range]) {
1087 for window in ranges.windows(2) {
1088 let inner = &window[0];
1089 let outer = &window[1];
1090 assert!(
1091 (inner.start.line > outer.start.line
1092 || (inner.start.line == outer.start.line
1093 && inner.start.character >= outer.start.character))
1094 && (inner.end.line < outer.end.line
1095 || (inner.end.line == outer.end.line
1096 && inner.end.character <= outer.end.character)),
1097 "Inner range {:?} should be contained within outer range {:?}",
1098 inner,
1099 outer,
1100 );
1101 }
1102 }
1103
1104 // ─── 1. Switch statement ────────────────────────────────────────────
1105

Callers 15

foreach_value_variableFunction · 0.85
foreach_key_valueFunction · 0.85
for_loop_bodyFunction · 0.85
while_loop_bodyFunction · 0.85
do_while_bodyFunction · 0.85
try_bodyFunction · 0.85
catch_bodyFunction · 0.85
finally_bodyFunction · 0.85
return_statement_valueFunction · 0.85
echo_statement_valueFunction · 0.85

Calls

no outgoing calls

Tested by 15

foreach_value_variableFunction · 0.68
foreach_key_valueFunction · 0.68
for_loop_bodyFunction · 0.68
while_loop_bodyFunction · 0.68
do_while_bodyFunction · 0.68
try_bodyFunction · 0.68
catch_bodyFunction · 0.68
finally_bodyFunction · 0.68
return_statement_valueFunction · 0.68
echo_statement_valueFunction · 0.68