(
&self,
path: &Path,
line: u32,
character: u32,
)
| 464 | } |
| 465 | |
| 466 | pub async fn references( |
| 467 | &self, |
| 468 | path: &Path, |
| 469 | line: u32, |
| 470 | character: u32, |
| 471 | ) -> Result<Vec<lsp_types::Location>, LspError> { |
| 472 | let uri = path_to_uri(path)?; |
| 473 | |
| 474 | let params = lsp_types::ReferenceParams { |
| 475 | text_document_position: lsp_types::TextDocumentPositionParams { |
| 476 | text_document: TextDocumentIdentifier { uri }, |
| 477 | position: lsp_types::Position { line, character }, |
| 478 | }, |
| 479 | work_done_progress_params: Default::default(), |
| 480 | partial_result_params: Default::default(), |
| 481 | context: lsp_types::ReferenceContext { |
| 482 | include_declaration: true, |
| 483 | }, |
| 484 | }; |
| 485 | |
| 486 | let result = self |
| 487 | .request("textDocument/references", serde_json::to_value(params)?) |
| 488 | .await?; |
| 489 | |
| 490 | if result.is_null() { |
| 491 | return Ok(vec![]); |
| 492 | } |
| 493 | |
| 494 | let locations: Vec<lsp_types::Location> = serde_json::from_value(result)?; |
| 495 | Ok(locations) |
| 496 | } |
| 497 | |
| 498 | pub async fn hover( |
| 499 | &self, |
no test coverage detected