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

Function switch_statement_case_body

src/selection_range.rs:1107–1131  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1105
1106 #[test]
1107 fn switch_statement_case_body() {
1108 let content = r#"<?php
1109switch ($x) {
1110 case 1:
1111 echo "one";
1112 break;
1113 case 2:
1114 echo "two";
1115 break;
1116 default:
1117 echo "other";
1118}
1119"#;
1120 // Cursor on "one" inside first case (line 3, char 14).
1121 let results = selection_ranges(content, &[Position::new(3, 14)]);
1122 assert_eq!(results.len(), 1);
1123 let ranges = flatten(&results[0]);
1124 // string → echo → case → { } → switch → file
1125 assert!(
1126 ranges.len() >= 4,
1127 "Expected at least 4 levels for switch case body, got {}",
1128 ranges.len()
1129 );
1130 assert_nested(&ranges);
1131 }
1132
1133 // ─── 2. Foreach loop ────────────────────────────────────────────────
1134

Callers

nothing calls this directly

Calls 3

selection_rangesFunction · 0.85
flattenFunction · 0.85
assert_nestedFunction · 0.85

Tested by

no test coverage detected