completion_items

Function completion_items 

Source
pub fn completion_items(
    document: &Document,
    position: Position,
    current_line: Option<&str>,
    workspace: Option<&CompletionWorkspace>,
    trigger_char: Option<&str>,
) -> Vec<CompletionCandidate>
Expand description

Returns completion candidates appropriate for the cursor position.

Analyzes the position to determine context (reference, verbatim label, etc.) and returns relevant suggestions. The candidates are deduplicated but not sorted—the LSP layer may apply additional ordering based on user preferences.

The optional trigger_char allows special handling for specific triggers:

  • @: Returns only file path completions (asset references)
  • [: Returns reference completions (annotations, definitions, sessions, paths)
  • :: Returns verbatim label completions
  • =: Returns path completions for src= parameters

Returns an empty vector if no completions are available.