Skip to main content

hover_info

Function hover_info 

Source
pub fn hover_info(
    cached_build: &CachedBuild,
    file_uri: &Url,
    position: Position,
    source_bytes: &[u8],
    compiled_text: Option<&str>,
) -> Option<Hover>
Expand description

Produce hover information for the symbol at the given position.

compiled_text is the buffer the cached AST was built from. The live buffer usually has unsaved edits, so the cursor is mapped into the compiled text before the AST lookup, and the hover is dropped when the identifier under the cursor differs there: a stale AST must not describe an unrelated symbol.