Interface CompletionContext

interface CompletionContext {
    document: LangiumDocument<AstNode>;
    features: NextFeature<GrammarAST.AbstractElement>[];
    node?: AstNode;
    offset: number;
    position: Position;
    textDocument: TextDocument;
    tokenEndOffset: number;
    tokenOffset: number;
}

Properties

node?: AstNode
offset: number

Index of the requested completed position.

position: Position
textDocument: TextDocument
tokenEndOffset: number

Index at the end of the token related to this context, even if it is behind the cursor position. Points at the first character after the last token. If the context performs completion for a token that doesn't exist yet, it is equal to the offset.

tokenOffset: number

Index at the start of the token related to this context. If the context performs completion for a token that doesn't exist yet, it is equal to the offset.