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

Function catch_body

src/selection_range.rs:1290–1311  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1288
1289 #[test]
1290 fn catch_body() {
1291 let content = r#"<?php
1292try {
1293 echo "try";
1294} catch (\Exception $e) {
1295 echo "catch";
1296} finally {
1297 echo "finally";
1298}
1299"#;
1300 // Cursor on "catch" string (line 4, char 10).
1301 let results = selection_ranges(content, &[Position::new(4, 10)]);
1302 assert_eq!(results.len(), 1);
1303 let ranges = flatten(&results[0]);
1304 // string → echo → catch block body → catch block → catch clause → try stmt → file
1305 assert!(
1306 ranges.len() >= 5,
1307 "Expected at least 5 levels for catch body, got {}",
1308 ranges.len()
1309 );
1310 assert_nested(&ranges);
1311 }
1312
1313 #[test]
1314 fn finally_body() {

Callers

nothing calls this directly

Calls 3

selection_rangesFunction · 0.85
flattenFunction · 0.85
assert_nestedFunction · 0.85

Tested by

no test coverage detected