MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / prepare_call_hierarchy

Method prepare_call_hierarchy

crates/opencode-lsp/src/lib.rs:682–711  ·  view source on GitHub ↗
(
        &self,
        path: &Path,
        line: u32,
        character: u32,
    )

Source from the content-addressed store, hash-verified

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,

Callers 3

incoming_callsMethod · 0.80
outgoing_callsMethod · 0.80
execute_with_lspFunction · 0.80

Calls 2

path_to_uriFunction · 0.85
requestMethod · 0.80

Tested by

no test coverage detected