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

Function finally_body

src/selection_range.rs:1314–1335  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1312
1313 #[test]
1314 fn finally_body() {
1315 let content = r#"<?php
1316try {
1317 echo "try";
1318} catch (\Exception $e) {
1319 echo "catch";
1320} finally {
1321 echo "finally";
1322}
1323"#;
1324 // Cursor on "finally" string (line 6, char 10).
1325 let results = selection_ranges(content, &[Position::new(6, 10)]);
1326 assert_eq!(results.len(), 1);
1327 let ranges = flatten(&results[0]);
1328 // string → echo → finally block body → finally block → finally clause → try stmt → file
1329 assert!(
1330 ranges.len() >= 5,
1331 "Expected at least 5 levels for finally body, got {}",
1332 ranges.len()
1333 );
1334 assert_nested(&ranges);
1335 }
1336
1337 // ─── 7. Return statement ────────────────────────────────────────────
1338

Callers

nothing calls this directly

Calls 3

selection_rangesFunction · 0.85
flattenFunction · 0.85
assert_nestedFunction · 0.85

Tested by

no test coverage detected