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>,
    file_id: Option<u64>,
) -> 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.

file_id is the AST source file id, needed for scope-aware resolution. When None, scope resolution is skipped and flat lookup is used.