pub fn get_function_completions(
ctx: &FunctionCompletionContext,
) -> Vec<CompletionItem>Expand description
Gets function completions filtered and scored by context.
This function returns SQL functions as completion items, filtered by prefix and with scoring adjustments based on the current context:
- Aggregate functions are boosted when GROUP BY is present
- Aggregate functions are penalized in WHERE clause
- Window functions are boosted in OVER/WINDOW context
ยงPerformance
Uses a pre-computed cache of function items. On each call, we:
- Filter the cache by prefix (if provided)
- Clone matching items
- Apply context-based scoring
This avoids re-computing signatures and format strings on every request.