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

Function implementation_at

tests/integration/implementation.rs:11–38  ·  view source on GitHub ↗
(
    backend: &phpantom_lsp::Backend,
    uri: &Url,
    line: u32,
    character: u32,
)

Source from the content-addressed store, hash-verified

9// ─── Helpers ────────────────────────────────────────────────────────────────
10
11async fn implementation_at(
12 backend: &phpantom_lsp::Backend,
13 uri: &Url,
14 line: u32,
15 character: u32,
16) -> Vec<Location> {
17 let params = GotoImplementationParams {
18 text_document_position_params: TextDocumentPositionParams {
19 text_document: TextDocumentIdentifier { uri: uri.clone() },
20 position: Position { line, character },
21 },
22 work_done_progress_params: WorkDoneProgressParams::default(),
23 partial_result_params: PartialResultParams::default(),
24 };
25
26 match backend.goto_implementation(params).await.unwrap() {
27 Some(GotoImplementationResponse::Scalar(loc)) => vec![loc],
28 Some(GotoImplementationResponse::Array(locs)) => locs,
29 Some(GotoImplementationResponse::Link(links)) => links
30 .into_iter()
31 .map(|l| Location {
32 uri: l.target_uri,
33 range: l.target_selection_range,
34 })
35 .collect(),
36 None => vec![],
37 }
38}
39
40async fn open(backend: &phpantom_lsp::Backend, uri: &Url, text: &str) {
41 backend

Calls 5

cloneMethod · 0.80
goto_implementationMethod · 0.80
into_iterMethod · 0.80
unwrapMethod · 0.45
mapMethod · 0.45