Class DefaultCompletionProvider

Language-specific service for handling completion requests.

Hierarchy (view full)

Implements

Constructors

Properties

astReflection: AstReflection
completionOptions?: CompletionProviderOptions

Contains the completion options for this completion provider.

If multiple languages return different options, they are merged before being sent to the language client.

completionParser: LangiumCompletionParser
documentationProvider: DocumentationProvider
fuzzyMatcher: FuzzyMatcher
grammar: Grammar
grammarConfig: GrammarConfig
lexer: Lexer
nameProvider: NameProvider
nodeKindProvider: NodeKindProvider
scopeProvider: ScopeProvider

Methods

  • Indicates whether the completion should continue to process the next completion context.

    The default implementation continues the completion only if there are currently no proposed completion items.

    Parameters

    • items: CompletionItem[]

    Returns boolean

  • The completion algorithm could yield the same reference/keyword multiple times.

    This methods deduplicates these items afterwards before returning to the client. Unique items are identified as a combination of kind, label and detail.

    Parameters

    • items: CompletionItem[]

    Returns CompletionItem[]

  • Override this method to change how the stream of candidates is determined for a reference. This way completion-specific modifications and refinements can be added to the proposals computation beyond the rules being implemented in the scope provider, e.g. filtering.

    Parameters

    • refInfo: ReferenceInfo

      Information about the reference for which the candidates are requested.

    • _context: CompletionContext

      Information about the completion request including document, cursor position, token under cursor, etc.

    Returns Stream<AstNodeDescription>

    A stream of all elements being valid for the given reference.