Skip to main content

completion

Function completion 

Source
pub fn completion(source: &str, offset: usize) -> Vec<CompletionItem>
Expand description

Returns completions appropriate at offset (byte offset) in source.

Uses the parsed AST to determine context:

  • Outside all declarations -> top-level keywords.
  • Inside a datasource or generator block -> config key suggestions.
  • Inside a model block:
    • After @ -> field attribute names.
    • After @@ -> model attribute names.
    • Otherwise -> scalar types, user-defined model/enum names, and common field attributes as a convenience.