Langium - v4.0.0
    Preparing search index...

    Class LangiumGrammarScopeComputation

    The default scope computation creates and collects descriptions of the AST nodes to be exported into the global scope from the given document. By default those are the document's root AST node and its directly contained child nodes.

    Besides, it gathers all AST nodes that have a name (according to the NameProvider service) and that are to be included in the local scope of their particular container nodes. They are collected in a DocumentSymbols table. As a result, for every cross-reference in the AST, target elements from the same level (siblings) and further up towards the root (parents and siblings of parents) are visible. Elements being nested inside lower levels (children, children of siblings and parents' siblings) are invisible by default, but that can be changed by customizing this service.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    astNodeLocator: AstNodeLocator
    nameProvider: NameProvider

    Methods

    • Creates descriptions of the local symbols being accessible within a document. The result is a LocalSymbols table assigning sets of AST node descriptions to the corresponding nodes/subtrees within the AST. The descriptions are considered in the default reference resolution implementation, i.e. they are used by the ScopeProvider service to determine which symbols are visible in the context of a specific cross-reference.

      Note: You should not resolve any cross-references in this service method. Cross-reference resolution depends on the scope computation phase to be completed.

      Parameters

      Returns Promise<LocalSymbols>

      OperationCanceled if a user action occurs during execution