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

Function highlight_this_keyword

tests/integration/document_highlight.rs:272–297  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

270
271#[test]
272fn highlight_this_keyword() {
273 let backend = create_test_backend();
274 let php = r#"<?php
275class 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

Callers

nothing calls this directly

Calls 2

create_test_backendFunction · 0.85
highlight_atFunction · 0.85

Tested by

no test coverage detected