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

Function completion_labels

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

Source from the content-addressed store, hash-verified

154 // ── Helper: completion labels at a position ─────────────────────────
155
156 async fn completion_labels(
157 backend: &phpantom_lsp::Backend,
158 uri: &str,
159 line: u32,
160 col: u32,
161 ) -> Vec<String> {
162 let params = CompletionParams {
163 text_document_position: TextDocumentPositionParams {
164 text_document: TextDocumentIdentifier {
165 uri: Url::parse(uri).unwrap(),
166 },
167 position: Position {
168 line,
169 character: col,
170 },
171 },
172 work_done_progress_params: WorkDoneProgressParams::default(),
173 partial_result_params: PartialResultParams::default(),
174 context: Some(CompletionContext {
175 trigger_kind: CompletionTriggerKind::TRIGGER_CHARACTER,
176 trigger_character: Some(">".to_string()),
177 }),
178 };
179 let result = backend.completion(params).await.unwrap();
180 match result {
181 Some(CompletionResponse::Array(items)) => items.into_iter().map(|i| i.label).collect(),
182 Some(CompletionResponse::List(list)) => {
183 list.items.into_iter().map(|i| i.label).collect()
184 }
185 None => vec![],
186 }
187 }
188
189 // ── Helper: GTD returns something ───────────────────────────────────
190

Callers 2

Calls 4

completionMethod · 0.80
into_iterMethod · 0.80
unwrapMethod · 0.45
mapMethod · 0.45

Tested by 2