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

Function for_loop_body

src/selection_range.rs:1200–1217  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1198
1199 #[test]
1200 fn for_loop_body() {
1201 let content = r#"<?php
1202for ($i = 0; $i < 10; $i++) {
1203 echo $i;
1204}
1205"#;
1206 // Cursor on $i in echo (line 2, char 10).
1207 let results = selection_ranges(content, &[Position::new(2, 10)]);
1208 assert_eq!(results.len(), 1);
1209 let ranges = flatten(&results[0]);
1210 // $i → echo → for body → for → file
1211 assert!(
1212 ranges.len() >= 3,
1213 "Expected at least 3 levels for for loop body, got {}",
1214 ranges.len()
1215 );
1216 assert_nested(&ranges);
1217 }
1218
1219 // ─── 4. While loop ─────────────────────────────────────────────────
1220

Callers

nothing calls this directly

Calls 3

selection_rangesFunction · 0.85
flattenFunction · 0.85
assert_nestedFunction · 0.85

Tested by

no test coverage detected