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

Function while_loop_body

src/selection_range.rs:1222–1239  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1220
1221 #[test]
1222 fn while_loop_body() {
1223 let content = r#"<?php
1224while (true) {
1225 echo "loop";
1226}
1227"#;
1228 // Cursor on "loop" (line 2, char 10).
1229 let results = selection_ranges(content, &[Position::new(2, 10)]);
1230 assert_eq!(results.len(), 1);
1231 let ranges = flatten(&results[0]);
1232 // string → echo → while body → while → file
1233 assert!(
1234 ranges.len() >= 3,
1235 "Expected at least 3 levels for while body, got {}",
1236 ranges.len()
1237 );
1238 assert_nested(&ranges);
1239 }
1240
1241 // ─── 5. Do-while loop ──────────────────────────────────────────────
1242

Callers

nothing calls this directly

Calls 3

selection_rangesFunction · 0.85
flattenFunction · 0.85
assert_nestedFunction · 0.85

Tested by

no test coverage detected