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

Function find_references

src/references/tests.rs:19–43  ·  view source on GitHub ↗

Helper: send a find-references request and return the locations.

(
    backend: &Backend,
    uri: &Url,
    line: u32,
    character: u32,
    include_declaration: bool,
)

Source from the content-addressed store, hash-verified

17
18/// Helper: send a find-references request and return the locations.
19async fn find_references(
20 backend: &Backend,
21 uri: &Url,
22 line: u32,
23 character: u32,
24 include_declaration: bool,
25) -> Vec<Location> {
26 let params = ReferenceParams {
27 text_document_position: TextDocumentPositionParams {
28 text_document: TextDocumentIdentifier { uri: uri.clone() },
29 position: Position { line, character },
30 },
31 work_done_progress_params: WorkDoneProgressParams::default(),
32 partial_result_params: PartialResultParams::default(),
33 context: ReferenceContext {
34 include_declaration,
35 },
36 };
37
38 backend
39 .references(params)
40 .await
41 .unwrap()
42 .unwrap_or_default()
43}
44
45// ─── Variable References ────────────────────────────────────────────────────
46

Calls 3

cloneMethod · 0.80
referencesMethod · 0.80
unwrapMethod · 0.45

Tested by

no test coverage detected