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.
Extends
Section titled “Extends”Member summary
Section titled “Member summary”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. |
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new TypeQLiteScopeComputation(
services):TypeQLiteScopeComputation
Defined in: node_modules/langium/lib/references/scope-computation.d.ts:63
Parameters
Section titled “Parameters”services
Section titled “services”Returns
Section titled “Returns”TypeQLiteScopeComputation
Inherited from
Section titled “Inherited from”DefaultScopeComputation.constructor
Methods
Section titled “Methods”collectExportedSymbols()
Section titled “collectExportedSymbols()”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.
Parameters
Section titled “Parameters”document
Section titled “document”cancelToken?
Section titled “cancelToken?”CancellationToken = Cancellation.CancellationToken.None
Returns
Section titled “Returns”Promise<AstNodeDescription[]>
Overrides
Section titled “Overrides”DefaultScopeComputation.collectExportedSymbols
collectExportedSymbolsForNode()
Section titled “collectExportedSymbolsForNode()”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.
Parameters
Section titled “Parameters”parentNode
Section titled “parentNode”AST node to be exported, i.e., of which an AstNodeDescription shall be added to the returned list.
document
Section titled “document”The document containing the AST node to be exported.
children?
Section titled “children?”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.
cancelToken?
Section titled “cancelToken?”CancellationToken
Indicates when to cancel the current operation.
Returns
Section titled “Returns”Promise<AstNodeDescription[]>
A list of AstNodeDescriptions to be published to index.
Throws
Section titled “Throws”OperationCancelled if a user action occurs during execution.
Inherited from
Section titled “Inherited from”DefaultScopeComputation.collectExportedSymbolsForNode
collectLocalSymbols()
Section titled “collectLocalSymbols()”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.
Parameters
Section titled “Parameters”document
Section titled “document”The document for which to compute its local symbols.
cancelToken?
Section titled “cancelToken?”CancellationToken
Indicates when to cancel the current operation.
Returns
Section titled “Returns”Promise<LocalSymbols>
Throws
Section titled “Throws”OperationCanceled if a user action occurs during execution
Inherited from
Section titled “Inherited from”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.