Interface LangiumDocument<T>

A Langium document holds the parse result (AST and CST) and any additional state that is derived from the AST, e.g. the result of scope precomputation.

interface LangiumDocument<T> {
    diagnostics?: Diagnostic[];
    parseResult: ParseResult<T>;
    precomputedScopes?: PrecomputedScopes;
    references: Reference<AstNode>[];
    state: DocumentState;
    textDocument: TextDocument;
    uri: URI;
}

Type Parameters

Properties

diagnostics?: Diagnostic[]

Result of the validation phase

parseResult: ParseResult<T>

The parse result holds the Abstract Syntax Tree (AST) and potentially also parser / lexer errors

precomputedScopes?: PrecomputedScopes

Result of the scope precomputation phase

references: Reference<AstNode>[]

An array of all cross-references found in the AST while linking

The current state of the document

textDocument: TextDocument

The text document used to convert between offsets and positions

uri: URI

The Uniform Resource Identifier (URI) of the document