Skip to content

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 ​

ts
new RuneDslIndexManager(services): RuneDslIndexManager;

Defined in: packages/core/src/services/rune-dsl-index-manager.ts:14

Parameters ​

ParameterType
servicesLangiumSharedCoreServices

Returns ​

RuneDslIndexManager

Overrides ​

DefaultIndexManager.constructor

Properties ​

PropertyModifierTypeDescriptionInherited fromDefined in
astReflectionprotected readonlyAstReflection-DefaultIndexManager.astReflectionnode_modules/.pnpm/[email protected]/node_modules/langium/lib/workspace/index-manager.d.ts:82
documentsprotected readonlyLangiumDocuments-DefaultIndexManager.documentsnode_modules/.pnpm/[email protected]/node_modules/langium/lib/workspace/index-manager.d.ts:81
referenceIndexprotected readonlyMap<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.referenceIndexnode_modules/.pnpm/[email protected]/node_modules/langium/lib/workspace/index-manager.d.ts:98
serviceRegistryprotected readonlyServiceRegistry-DefaultIndexManager.serviceRegistrynode_modules/.pnpm/[email protected]/node_modules/langium/lib/workspace/index-manager.d.ts:80
symbolByTypeIndexprotected readonlyContextCache<string, string, AstNodeDescription[], string>This is a cache for the allElements() method. It caches the descriptions from symbolIndex grouped by types.DefaultIndexManager.symbolByTypeIndexnode_modules/.pnpm/[email protected]/node_modules/langium/lib/workspace/index-manager.d.ts:92
symbolIndexprotected readonlyMap<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.symbolIndexnode_modules/.pnpm/[email protected]/node_modules/langium/lib/workspace/index-manager.d.ts:87

Methods ​

allElements() ​

ts
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 ​

ParameterTypeDescription
nodeType?stringThe 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() ​

ts
clearExports(uri): void;

Defined in: packages/core/src/services/rune-dsl-index-manager.ts:35

Clear previously registered exports for a document URI.

Parameters ​

ParameterType
uriURI

Returns ​

void


findAllReferences() ​

ts
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 ​

ParameterTypeDescription
targetNodeAstNodethe AstNode to look up references for
astNodePathstringthe 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() ​

ts
protected getFileDescriptions(uri, nodeType?): AstNodeDescription[];

Defined in: node_modules/.pnpm/[email protected]/node_modules/langium/lib/workspace/index-manager.d.ts:102

Parameters ​

ParameterType
uristring
nodeType?string

Returns ​

AstNodeDescription[]

Inherited from ​

DefaultIndexManager.getFileDescriptions


isAffected() ​

ts
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 ​

ParameterTypeDescription
documentLangiumDocumentDocument to check whether it's affected
changedUrisSet<string>URIs of the changed documents

Returns ​

boolean

Inherited from ​

DefaultIndexManager.isAffected


registerExports() ​

ts
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 ​

ParameterType
uriURI
descriptionsAstNodeDescription[]

Returns ​

void


remove() ​

ts
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 ​

ParameterTypeDescription
uriURIThe URI of the document for which index data shall be removed

Returns ​

void

Inherited from ​

DefaultIndexManager.remove


removeContent() ​

ts
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 ​

ParameterType
uriURI

Returns ​

void

Inherited from ​

DefaultIndexManager.removeContent


removeReferences() ​

ts
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 ​

ParameterType
uriURI

Returns ​

void

Inherited from ​

DefaultIndexManager.removeReferences


updateContent() ​

ts
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 ​

ParameterTypeDescription
documentLangiumDocumentDocument to be updated
cancelToken?CancellationTokenIndicates when to cancel the current operation.

Returns ​

Promise<void>

Throws ​

OperationCanceled if a user action occurs during execution

Inherited from ​

DefaultIndexManager.updateContent


updateReferences() ​

ts
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 ​

ParameterTypeDescription
documentLangiumDocumentDocument to be updated
cancelToken?CancellationTokenIndicates when to cancel the current operation.

Returns ​

Promise<void>

Throws ​

OperationCanceled if a user action occurs during execution

Inherited from ​

DefaultIndexManager.updateReferences

Core packages released under MIT. Studio app released under FSL-1.1-ALv2.