Skip to main content

handle_completion

Function handle_completion 

Source
pub fn handle_completion(
    cache: Option<&CompletionCache>,
    source_text: &str,
    position: Position,
    trigger_char: Option<&str>,
    fast: bool,
) -> Option<CompletionResponse>
Expand description

Handle a completion request.

When cache is Some, full AST-aware completions are returned. When cache is None, only static completions (keywords, globals, units) and magic dot completions (msg., block., tx., abi., type().) are returned immediately — no blocking.

When fast is true, general completions use the pre-built list from the cache (zero per-request allocation). When false, get_general_completions is called which allows per-request filtering (e.g. scope-aware completions).