Skip to content

TypeQLiteScopeComputation

Defined in: libs/language/src/typeqlite-scope-computation.ts:29

What a TypeQLite document contributes to the workspace’s one schema (ADR-008 D3).

Every named definition in a define clause is exported under its label. A re-open (employment relates manager;) is exported too, under the label it re-opens, so that the role scope can find its traits wherever it is written. No cross-reference targets a TypeExtensionDef, so exporting one cannot make a reference resolve to it.

Constructors

Name Description
new TypeQLiteScopeComputation() Inherited from langium.

Methods

Name Description
collectExportedSymbols() Exports every named definition of each define clause under its label, and each re-open under the label it re-opens, so that references resolve across clauses and across files.
collectExportedSymbolsForNode() Creates AstNodeDescriptions for the given parentNode and its children.
collectLocalSymbols() Creates descriptions of the local symbols being accessible within a document.

new TypeQLiteScopeComputation(services): TypeQLiteScopeComputation

Defined in: node_modules/langium/lib/references/scope-computation.d.ts:63

LangiumCoreServices

TypeQLiteScopeComputation

DefaultScopeComputation.constructor

collectExportedSymbols(document, cancelToken?): Promise<AstNodeDescription[]>

Defined in: libs/language/src/typeqlite-scope-computation.ts:34

Exports every named definition of each define clause under its label, and each re-open under the label it re-opens, so that references resolve across clauses and across files.

LangiumDocument

CancellationToken = Cancellation.CancellationToken.None

Promise<AstNodeDescription[]>

DefaultScopeComputation.collectExportedSymbols


collectExportedSymbolsForNode(parentNode, document, children?, cancelToken?): Promise<AstNodeDescription[]>

Defined in: node_modules/langium/lib/references/scope-computation.d.ts:77

Creates AstNodeDescriptions for the given 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.

AstNode

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

LangiumDocument<AstNode>

The document containing the AST node to be exported.

(root) => 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.

CancellationToken

Indicates when to cancel the current operation.

Promise<AstNodeDescription[]>

A list of AstNodeDescriptions to be published to index.

OperationCancelled if a user action occurs during execution.

DefaultScopeComputation.collectExportedSymbolsForNode


collectLocalSymbols(document, cancelToken?): Promise<LocalSymbols>

Defined in: node_modules/langium/lib/references/scope-computation.d.ts:83

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.

LangiumDocument

The document for which to compute its local symbols.

CancellationToken

Indicates when to cancel the current operation.

Promise<LocalSymbols>

OperationCanceled if a user action occurs during execution

DefaultScopeComputation.collectLocalSymbols

TypeDBLite is an independent open-source project, built on TypeDB with thanks. It is not affiliated with, sponsored by, or endorsed by TypeDB Ltd. Released under the MPL-2.0 license.