(
&self,
path: &Path,
line: u32,
character: u32,
)
| 680 | } |
| 681 | |
| 682 | pub async fn prepare_call_hierarchy( |
| 683 | &self, |
| 684 | path: &Path, |
| 685 | line: u32, |
| 686 | character: u32, |
| 687 | ) -> Result<Vec<CallHierarchyItem>, LspError> { |
| 688 | let uri = path_to_uri(path)?; |
| 689 | |
| 690 | let params = CallHierarchyPrepareParams { |
| 691 | text_document_position_params: lsp_types::TextDocumentPositionParams { |
| 692 | text_document: TextDocumentIdentifier { uri }, |
| 693 | position: lsp_types::Position { line, character }, |
| 694 | }, |
| 695 | work_done_progress_params: Default::default(), |
| 696 | }; |
| 697 | |
| 698 | let result = self |
| 699 | .request( |
| 700 | "textDocument/prepareCallHierarchy", |
| 701 | serde_json::to_value(params)?, |
| 702 | ) |
| 703 | .await?; |
| 704 | |
| 705 | if result.is_null() { |
| 706 | return Ok(vec![]); |
| 707 | } |
| 708 | |
| 709 | let items: Vec<CallHierarchyItem> = serde_json::from_value(result)?; |
| 710 | Ok(items) |
| 711 | } |
| 712 | |
| 713 | pub async fn incoming_calls( |
| 714 | &self, |
no test coverage detected