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

Function class_method_body

src/selection_range.rs:950–969  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

948
949 #[test]
950 fn class_method_body() {
951 let content = r#"<?php
952class Greeter {
953 public function greet(string $name): string {
954 return "Hello, " . $name;
955 }
956}
957"#;
958 // Position cursor on `$name` in the return statement (line 3, char 29).
959 let results = selection_ranges(content, &[Position::new(3, 29)]);
960 assert_eq!(results.len(), 1);
961 let ranges = flatten(&results[0]);
962
963 // Should have levels: variable → expression → return → block → method → class body → class → file.
964 assert!(
965 ranges.len() >= 4,
966 "Expected at least 4 selection range levels, got {}",
967 ranges.len()
968 );
969 }
970
971 #[test]
972 fn multiple_positions() {

Callers

nothing calls this directly

Calls 2

selection_rangesFunction · 0.85
flattenFunction · 0.85

Tested by

no test coverage detected