()
| 270 | |
| 271 | #[test] |
| 272 | fn highlight_this_keyword() { |
| 273 | let backend = create_test_backend(); |
| 274 | let php = r#"<?php |
| 275 | class Example { |
| 276 | private int $x; |
| 277 | public function setX(int $v): void { |
| 278 | $this->x = $v; |
| 279 | } |
| 280 | public function getX(): int { |
| 281 | return $this->x; |
| 282 | } |
| 283 | } |
| 284 | "#; |
| 285 | |
| 286 | // Cursor on `$this` at line 4 |
| 287 | let highlights = highlight_at(&backend, "file:///test.php", php, 4, 9); |
| 288 | |
| 289 | assert!( |
| 290 | highlights.len() >= 2, |
| 291 | "expected at least 2 highlights for $this, got {}", |
| 292 | highlights.len() |
| 293 | ); |
| 294 | for h in &highlights { |
| 295 | assert_eq!(h.kind, Some(DocumentHighlightKind::READ)); |
| 296 | } |
| 297 | } |
| 298 | |
| 299 | // ─── self/static/parent highlighting ──────────────────────────────────────── |
| 300 |
nothing calls this directly
no test coverage detected