Class OmlScopeComputation

Extension of the default Langium scope computation implementation to support visibility of all elements defined in a file at the global scope and to export all elements via full IRI

Hierarchy

  • DefaultScopeComputation
    • OmlScopeComputation

Constructors

Properties

descriptions: AstNodeDescriptionProvider
nameProvider: NameProvider

Methods

  • Export all members using their fully qualified name

    Parameters

    • document: LangiumDocument<AstNode>

    Returns Promise<AstNodeDescription[]>

  • Creates AstNodeDescription AstNodeDescriptions for the given AstNode parentNode and its children. The list of children to be considered is determined by the function parameter children. By default only the direct children of parentNode are visited, nested nodes are not exported.

    Throws

    OperationCanceled if a user action occurs during execution.

    Returns

    A list of AstNodeDescription AstNodeDescriptions to be published to index.

    Parameters

    • parentNode: AstNode

      AST node to be exported, i.e., of which an AstNodeDescription shall be added to the returned list.

    • document: LangiumDocument<AstNode>

      The document containing the AST node to be exported.

    • Optional children: ((root: AstNode) => Iterable<AstNode>)

      A function called with parentNode as single argument and returning an Iterable supplying the children to be visited, which must be directly or transitively contained in parentNode.

        • (root: AstNode): Iterable<AstNode>
        • Parameters

          • root: AstNode

          Returns Iterable<AstNode>

    • Optional cancelToken: CancellationToken

      Indicates when to cancel the current operation.

    Returns Promise<AstNodeDescription[]>

  • Parameters

    • document: LangiumDocument<AstNode>

    Returns Promise<PrecomputedScopes>

  • Add a single node to the list of exports if it has a name. Override this method to change how symbols are exported, e.g. by modifying their exported name.

    Parameters

    • node: AstNode
    • exports: AstNodeDescription[]
    • document: LangiumDocument<AstNode>

    Returns void

  • Process a single node during scopes computation. The default implementation makes the node visible in the subtree of its container (if the node has a name). Override this method to change this, e.g. by increasing the visibility to a higher level in the AST.

    Parameters

    • node: AstNode
    • document: LangiumDocument<AstNode>
    • scopes: PrecomputedScopes

    Returns void

Generated using TypeDoc