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

Function try_body

src/selection_range.rs:1266–1287  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1264
1265 #[test]
1266 fn try_body() {
1267 let content = r#"<?php
1268try {
1269 echo "try";
1270} catch (\Exception $e) {
1271 echo "catch";
1272} finally {
1273 echo "finally";
1274}
1275"#;
1276 // Cursor on "try" string (line 2, char 10).
1277 let results = selection_ranges(content, &[Position::new(2, 10)]);
1278 assert_eq!(results.len(), 1);
1279 let ranges = flatten(&results[0]);
1280 // string → echo → try block body → try block → try stmt → file
1281 assert!(
1282 ranges.len() >= 4,
1283 "Expected at least 4 levels for try body, got {}",
1284 ranges.len()
1285 );
1286 assert_nested(&ranges);
1287 }
1288
1289 #[test]
1290 fn catch_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