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

Method hover

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

Source from the content-addressed store, hash-verified

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,

Callers 1

execute_with_lspFunction · 0.80

Calls 2

path_to_uriFunction · 0.85
requestMethod · 0.80

Tested by

no test coverage detected