Skip to main content

detect_structural_intent

Function detect_structural_intent 

Source
pub fn detect_structural_intent(query: &str) -> Option<ChunkKind>
Expand description

Detects structural intent in user queries (e.g., “class X”, “function foo”) Returns the ChunkKind that matches the intent, if any

This function now only returns a kind when the query contains BOTH:

  1. A structural keyword (class, struct, function, method, enum, interface, trait)
  2. A PascalCase or snake_case identifier suggesting a specific type/function

This prevents excessive noise where “enum” would boost ALL enums in results