rune-langium / core/src / RuneDslIndexManager
Class: RuneDslIndexManager
Defined in: packages/core/src/services/rune-dsl-index-manager.ts:13
Extended IndexManager that supports external registration of exported symbols without requiring a full document build. Used for deferred deserialization of curated model artifacts (ADR 007 Phase 4).
Extends
DefaultIndexManager
Constructors
Constructor
new RuneDslIndexManager(services): RuneDslIndexManager;Defined in: packages/core/src/services/rune-dsl-index-manager.ts:14
Parameters
| Parameter | Type |
|---|---|
services | LangiumSharedCoreServices |
Returns
RuneDslIndexManager
Overrides
DefaultIndexManager.constructor
Properties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
astReflection | protected readonly | AstReflection | - | DefaultIndexManager.astReflection | node_modules/.pnpm/[email protected]/node_modules/langium/lib/workspace/index-manager.d.ts:82 |
documents | protected readonly | LangiumDocuments | - | DefaultIndexManager.documents | node_modules/.pnpm/[email protected]/node_modules/langium/lib/workspace/index-manager.d.ts:81 |
referenceIndex | protected readonly | Map<string, ReferenceDescription[]> | This index keeps track of all ReferenceDescription items exported by a document. This is used to compute which elements are affected by a document change and for finding references to an AST node. | DefaultIndexManager.referenceIndex | node_modules/.pnpm/[email protected]/node_modules/langium/lib/workspace/index-manager.d.ts:98 |
serviceRegistry | protected readonly | ServiceRegistry | - | DefaultIndexManager.serviceRegistry | node_modules/.pnpm/[email protected]/node_modules/langium/lib/workspace/index-manager.d.ts:80 |
symbolByTypeIndex | protected readonly | ContextCache<string, string, AstNodeDescription[], string> | This is a cache for the allElements() method. It caches the descriptions from symbolIndex grouped by types. | DefaultIndexManager.symbolByTypeIndex | node_modules/.pnpm/[email protected]/node_modules/langium/lib/workspace/index-manager.d.ts:92 |
symbolIndex | protected readonly | Map<string, AstNodeDescription[]> | The symbol index stores all AstNodeDescription items exported by a document. The key used in this map is the string representation of the specific document URI. | DefaultIndexManager.symbolIndex | node_modules/.pnpm/[email protected]/node_modules/langium/lib/workspace/index-manager.d.ts:87 |
Methods
allElements()
allElements(nodeType?, uris?): Stream<AstNodeDescription>;Defined in: node_modules/.pnpm/[email protected]/node_modules/langium/lib/workspace/index-manager.d.ts:101
Compute a list of all exported elements, optionally filtered using a type identifier and document URIs.
Parameters
| Parameter | Type | Description |
|---|---|---|
nodeType? | string | The type to filter with, or undefined to return descriptions of all types. |
uris? | Set<string> | If specified, only returns elements from the given URIs. |
Returns
Stream<AstNodeDescription>
a Stream containing all globally visible nodes (of a given type).
Inherited from
DefaultIndexManager.allElements
clearExports()
clearExports(uri): void;Defined in: packages/core/src/services/rune-dsl-index-manager.ts:35
Clear previously registered exports for a document URI.
Parameters
| Parameter | Type |
|---|---|
uri | URI |
Returns
void
findAllReferences()
findAllReferences(targetNode, astNodePath): Stream<ReferenceDescription>;Defined in: node_modules/.pnpm/[email protected]/node_modules/langium/lib/workspace/index-manager.d.ts:100
Returns all known references that are pointing to the given targetNode.
Parameters
| Parameter | Type | Description |
|---|---|---|
targetNode | AstNode | the AstNode to look up references for |
astNodePath | string | the path that points to the targetNode inside the document. See also AstNodeLocator |
Returns
Stream<ReferenceDescription>
a Stream of references that are targeting the targetNode
Inherited from
DefaultIndexManager.findAllReferences
getFileDescriptions()
protected getFileDescriptions(uri, nodeType?): AstNodeDescription[];Defined in: node_modules/.pnpm/[email protected]/node_modules/langium/lib/workspace/index-manager.d.ts:102
Parameters
| Parameter | Type |
|---|---|
uri | string |
nodeType? | string |
Returns
AstNodeDescription[]
Inherited from
DefaultIndexManager.getFileDescriptions
isAffected()
isAffected(document, changedUris): boolean;Defined in: node_modules/.pnpm/[email protected]/node_modules/langium/lib/workspace/index-manager.d.ts:108
Determine whether the given document could be affected by changes of the documents identified by the given URIs (second parameter). The document is typically regarded as affected if it contains a reference to any of the changed files.
Parameters
| Parameter | Type | Description |
|---|---|---|
document | LangiumDocument | Document to check whether it's affected |
changedUris | Set<string> | URIs of the changed documents |
Returns
boolean
Inherited from
DefaultIndexManager.isAffected
registerExports()
registerExports(uri, descriptions): void;Defined in: packages/core/src/services/rune-dsl-index-manager.ts:27
Register exported symbol descriptions for a document URI without requiring the document to be parsed or built. The descriptions are added directly to the symbol index, making them discoverable via allElements() and cross-reference resolution.
Call clearExports(uri) or remove(uri) before re-registering to avoid duplicates.
Parameters
| Parameter | Type |
|---|---|
uri | URI |
descriptions | AstNodeDescription[] |
Returns
void
remove()
remove(uri): void;Defined in: node_modules/.pnpm/[email protected]/node_modules/langium/lib/workspace/index-manager.d.ts:103
Remove the specified document URI from the index. Necessary when documents are deleted and not referenceable anymore.
Parameters
| Parameter | Type | Description |
|---|---|---|
uri | URI | The URI of the document for which index data shall be removed |
Returns
void
Inherited from
DefaultIndexManager.remove
removeContent()
removeContent(uri): void;Defined in: node_modules/.pnpm/[email protected]/node_modules/langium/lib/workspace/index-manager.d.ts:104
Remove only the information about the exportable content of a document.
Parameters
| Parameter | Type |
|---|---|
uri | URI |
Returns
void
Inherited from
DefaultIndexManager.removeContent
removeReferences()
removeReferences(uri): void;Defined in: node_modules/.pnpm/[email protected]/node_modules/langium/lib/workspace/index-manager.d.ts:105
Remove only the information about the cross-references of a document.
Parameters
| Parameter | Type |
|---|---|
uri | URI |
Returns
void
Inherited from
DefaultIndexManager.removeReferences
updateContent()
updateContent(document, cancelToken?): Promise<void>;Defined in: node_modules/.pnpm/[email protected]/node_modules/langium/lib/workspace/index-manager.d.ts:106
Update the information about the exportable content of a document inside the index.
Parameters
| Parameter | Type | Description |
|---|---|---|
document | LangiumDocument | Document to be updated |
cancelToken? | CancellationToken | Indicates when to cancel the current operation. |
Returns
Promise<void>
Throws
OperationCanceled if a user action occurs during execution
Inherited from
DefaultIndexManager.updateContent
updateReferences()
updateReferences(document, cancelToken?): Promise<void>;Defined in: node_modules/.pnpm/[email protected]/node_modules/langium/lib/workspace/index-manager.d.ts:107
Update the information about the cross-references of a document inside the index.
Parameters
| Parameter | Type | Description |
|---|---|---|
document | LangiumDocument | Document to be updated |
cancelToken? | CancellationToken | Indicates when to cancel the current operation. |
Returns
Promise<void>
Throws
OperationCanceled if a user action occurs during execution
Inherited from
DefaultIndexManager.updateReferences