Skip to main content

prefix_completion_helper

Function prefix_completion_helper 

Source
pub fn prefix_completion_helper<'a>(
    word: &TokenComponent,
    prefixes: &'a Prefixes,
    completions: &mut Vec<SimpleCompletion>,
    extra_edits: impl FnMut(&str, &str) -> Option<Vec<TextEdit>>,
    lovs: impl Iterator<Item = &'a LocalPrefix>,
    prefix_cc: impl Iterator<Item = &'a PrefixEntry>,
    lang: &DynLang,
)
Expand description

Prefix suggestions for the word at the cursor.

Prefixes the document declares are always suggested. Undeclared prefixes (built-in vocabularies, then prefix.cc in popularity order) only once something was typed, and at most MAX_UNDECLARED_PREFIXES: with an empty word every one of the ~3,400 known prefixes would match, burying everything else.