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

Function hover_this_variable

tests/integration/hover.rs:116–132  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

114
115#[test]
116fn hover_this_variable() {
117 let backend = create_test_backend();
118 let uri = "file:///test.php";
119 let content = r#"<?php
120class User {
121 public function greet(): string {
122 return $this->name();
123 }
124}
125"#;
126
127 // Hover on `$this` (line 3, within the `$this` token)
128 let hover = hover_at(&backend, uri, content, 3, 16).expect("expected hover");
129 let text = hover_text(&hover);
130 assert!(text.contains("$this"), "should mention $this: {}", text);
131 assert!(text.contains("User"), "should resolve to User: {}", text);
132}
133
134#[test]
135fn hover_variable_with_type() {

Callers

nothing calls this directly

Calls 3

create_test_backendFunction · 0.85
hover_atFunction · 0.70
hover_textFunction · 0.70

Tested by

no test coverage detected