(
&self,
path: &Path,
line: u32,
character: u32,
)
| 496 | } |
| 497 | |
| 498 | pub async fn hover( |
| 499 | &self, |
| 500 | path: &Path, |
| 501 | line: u32, |
| 502 | character: u32, |
| 503 | ) -> Result<Option<lsp_types::Hover>, LspError> { |
| 504 | let uri = path_to_uri(path)?; |
| 505 | |
| 506 | let params = lsp_types::HoverParams { |
| 507 | text_document_position_params: lsp_types::TextDocumentPositionParams { |
| 508 | text_document: TextDocumentIdentifier { uri }, |
| 509 | position: lsp_types::Position { line, character }, |
| 510 | }, |
| 511 | work_done_progress_params: Default::default(), |
| 512 | }; |
| 513 | |
| 514 | let result = self |
| 515 | .request("textDocument/hover", serde_json::to_value(params)?) |
| 516 | .await?; |
| 517 | |
| 518 | if result.is_null() { |
| 519 | return Ok(None); |
| 520 | } |
| 521 | |
| 522 | let hover: lsp_types::Hover = serde_json::from_value(result)?; |
| 523 | Ok(Some(hover)) |
| 524 | } |
| 525 | |
| 526 | pub async fn document_symbol( |
| 527 | &self, |
no test coverage detected