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

Function hover_text

tests/integration/blade_debug.rs:119–152  ·  view source on GitHub ↗
(
        backend: &phpantom_lsp::Backend,
        uri: &str,
        line: u32,
        col: u32,
    )

Source from the content-addressed store, hash-verified

117 // ── Helper: hover at a position and return the hover text ───────────
118
119 async fn hover_text(
120 backend: &phpantom_lsp::Backend,
121 uri: &str,
122 line: u32,
123 col: u32,
124 ) -> Option<String> {
125 let params = HoverParams {
126 text_document_position_params: TextDocumentPositionParams {
127 text_document: TextDocumentIdentifier {
128 uri: Url::parse(uri).unwrap(),
129 },
130 position: Position {
131 line,
132 character: col,
133 },
134 },
135 work_done_progress_params: WorkDoneProgressParams::default(),
136 };
137 let result = backend.hover(params).await.unwrap()?;
138 match result.contents {
139 HoverContents::Markup(m) => Some(m.value),
140 HoverContents::Scalar(MarkedString::String(s)) => Some(s),
141 HoverContents::Scalar(MarkedString::LanguageString(ls)) => Some(ls.value),
142 HoverContents::Array(arr) => Some(
143 arr.into_iter()
144 .map(|m| match m {
145 MarkedString::String(s) => s,
146 MarkedString::LanguageString(ls) => ls.value,
147 })
148 .collect::<Vec<_>>()
149 .join("\n"),
150 ),
151 }
152 }
153
154 // ── Helper: completion labels at a position ─────────────────────────
155

Callers 9

test_hover_author_phpFunction · 0.70
test_hover_author_bladeFunction · 0.70
test_hover_post_phpFunction · 0.70
test_hover_post_bladeFunction · 0.70
test_hover_chained_phpFunction · 0.70
test_hover_chained_bladeFunction · 0.70
test_foreach_var_phpFunction · 0.70
test_foreach_var_bladeFunction · 0.70

Calls 4

into_iterMethod · 0.80
unwrapMethod · 0.45
hoverMethod · 0.45
mapMethod · 0.45

Tested by 9

test_hover_author_phpFunction · 0.56
test_hover_author_bladeFunction · 0.56
test_hover_post_phpFunction · 0.56
test_hover_post_bladeFunction · 0.56
test_hover_chained_phpFunction · 0.56
test_hover_chained_bladeFunction · 0.56
test_foreach_var_phpFunction · 0.56
test_foreach_var_bladeFunction · 0.56