Skip to main content

hover_cutover

Function hover_cutover 

Source
pub fn hover_cutover<Q>(
    legacy_hover_text: Option<String>,
    semantic_queries: &Q,
    symbol: &str,
    file_id: FileId,
    byte_offset: u32,
    scope_id: Option<ScopeId>,
) -> HoverCutoverOutcome
where Q: SemanticQueries,
Expand description

Run hover with the semantic path as primary, falling back to legacy when the semantic result is unavailable.

§Decision logic

  1. Call SemanticQueries::symbol_at for the entity at the hover position.
  2. Call SemanticQueries::visible_symbols_at for origin metadata.
  3. Classify the result:
    • Exact: entity found with high/medium confidence → explain symbol.
    • DynamicBoundary: entity has dynamic-boundary provenance → explain boundary.
    • Ambiguous: multiple visible symbols match → explain ambiguity.
    • Unavailable: no entity found → fall back to legacy hover text.
  4. Emit a shadow-compare receipt regardless of outcome.