MCPcopy Index your code
hub / github.com/PHPantom-dev/phpantom_lsp / extract_hover_text

Function extract_hover_text

tests/fixture_runner.rs:471–485  ·  view source on GitHub ↗

Extract the text content from a Hover response.

(hover: &Hover)

Source from the content-addressed store, hash-verified

469
470/// Extract the text content from a Hover response.
471fn extract_hover_text(hover: &Hover) -> String {
472 match &hover.contents {
473 HoverContents::Markup(mc) => mc.value.clone(),
474 HoverContents::Scalar(MarkedString::String(s)) => s.clone(),
475 HoverContents::Scalar(MarkedString::LanguageString(ls)) => ls.value.clone(),
476 HoverContents::Array(items) => items
477 .iter()
478 .map(|ms| match ms {
479 MarkedString::String(s) => s.clone(),
480 MarkedString::LanguageString(ls) => ls.value.clone(),
481 })
482 .collect::<Vec<_>>()
483 .join("\n"),
484 }
485}
486
487async fn run_hover(fixture: &ParsedFixture) -> Result<(), String> {
488 let backend = create_fixture_backend();

Callers 1

run_hoverFunction · 0.70

Calls 3

cloneMethod · 0.80
iterMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected