This service provides the API to define the actual types, inference rules and validation rules for a textual DSL developed with Langium in order to include them into the Langium lifecycle.

interface LangiumTypeCreator {
    onInitialize(): void;
    onNewAstNode(languageNode: AstNode): void;
    triggerInitialization(): void;
}

Implemented by

Methods

  • For the initialization of the type system, e.g. to register primitive types and operators, inference rules and validation rules, which are constant and don't depend on the actual language nodes. This method will be executed once before the first added/updated/removed language node.

    Returns void

  • React on updates of the AST in order to add/remove corresponding types from the type system, e.g. for user-defined functions to create corresponding function types in the type graph.

    Parameters

    • languageNode: AstNode

      an AstNode of the current AST

    Returns void