Skip to content

TypeQLiteDocumentBuilder

Defined in: libs/language/src/typeqlite-label-providers.ts:218

Relinks a document that holds labels whenever any document changes.

Constructors

Name Description
new TypeQLiteDocumentBuilder() Inherited from langium.

Properties

Name Description
updateBuildOptions The options used for rebuilding documents after an update.

Methods

Name Description
build() Execute all necessary build steps for the given documents.
onBuildPhase() Notify the given callback when a set of documents has been built reaching the specified target state.
onDocumentPhase() Notify the specified callback when a document has been built reaching the specified target state.
onUpdate() Notify the given callback when a document update was triggered, but before any document is rebuilt.
resetToState() Reset the state of a document to the specified state, removing any derived data as needed.
update() This method is called when a document change is detected.
waitUntil() Wait until the workspace has reached the specified state for all documents.

new TypeQLiteDocumentBuilder(services): TypeQLiteDocumentBuilder

Defined in: node_modules/langium/lib/workspace/document-builder.d.ts:138

LangiumSharedCoreServices

TypeQLiteDocumentBuilder

DefaultDocumentBuilder.constructor

updateBuildOptions: BuildOptions

Defined in: node_modules/langium/lib/workspace/document-builder.d.ts:124

The options used for rebuilding documents after an update.

DefaultDocumentBuilder.updateBuildOptions

build<T>(documents, options?, cancelToken?): Promise<void>

Defined in: node_modules/langium/lib/workspace/document-builder.d.ts:139

Execute all necessary build steps for the given documents.

T extends AstNode

LangiumDocument<T>[]

Set of documents to be built.

BuildOptions

Options for the document builder.

CancellationToken

Indicates when to cancel the current operation.

Promise<void>

OperationCanceled if a user action occurs during execution

DefaultDocumentBuilder.build


onBuildPhase(targetState, callback): Disposable

Defined in: node_modules/langium/lib/workspace/document-builder.d.ts:190

Notify the given callback when a set of documents has been built reaching the specified target state.

DocumentState

DocumentBuildListener

Disposable

DefaultDocumentBuilder.onBuildPhase


onDocumentPhase(targetState, callback): Disposable

Defined in: node_modules/langium/lib/workspace/document-builder.d.ts:191

Notify the specified callback when a document has been built reaching the specified target state. Unlike onBuildPhase the listener is called for every single document.

There are two main advantages compared to onBuildPhase:

  1. If the build is cancelled, onDocumentPhase will still fire for documents that have reached a specific state. Meanwhile, onBuildPhase won’t fire for that state.
  2. The DocumentBuilder ensures that all DocumentPhaseListener instances are called for a built document. Even if the build is cancelled before those listeners were called.

DocumentState

DocumentPhaseListener

Disposable

DefaultDocumentBuilder.onDocumentPhase


onUpdate(callback): Disposable

Defined in: node_modules/langium/lib/workspace/document-builder.d.ts:158

Notify the given callback when a document update was triggered, but before any document is rebuilt. Listeners to this event should not perform any long-running task.

DocumentUpdateListener

Disposable

DefaultDocumentBuilder.onUpdate


resetToState<T>(document, state): void

Defined in: node_modules/langium/lib/workspace/document-builder.d.ts:159

Reset the state of a document to the specified state, removing any derived data as needed.

T extends AstNode

LangiumDocument<T>

The document to reset.

DocumentState

The state to reset the document to.

void

DefaultDocumentBuilder.resetToState


update(changed, deleted, cancelToken?): Promise<void>

Defined in: node_modules/langium/lib/workspace/document-builder.d.ts:140

This method is called when a document change is detected. It updates the state of all affected documents, including those with references to the changed ones, so they are rebuilt.

URI[]

URIs of changed or created documents

URI[]

URIs of deleted documents

CancellationToken

allows to cancel the current operation

Promise<void>

OperationCancelled if cancellation is detected during execution

DefaultDocumentBuilder.update


waitUntil(state, cancelToken?): Promise<void>

Defined in: node_modules/langium/lib/workspace/document-builder.d.ts:192

Wait until the workspace has reached the specified state for all documents.

DocumentState

The desired state. The promise won’t resolve until all documents have reached this state

CancellationToken

Optionally allows to cancel the wait operation, disposing any listeners in the process

Promise<void>

OperationCancelled if cancellation has been requested before the state has been reached

DefaultDocumentBuilder.waitUntil

waitUntil(state, uri?, cancelToken?): Promise<URI>

Defined in: node_modules/langium/lib/workspace/document-builder.d.ts:193

Wait until the document specified by the uri has reached the specified state.

DocumentState

The desired state. The promise won’t resolve until the document has reached this state.

URI

The specified URI that points to the document. If the URI does not exist, the promise will resolve once the workspace has reached the specified state.

CancellationToken

Optionally allows to cancel the wait operation, disposing any listeners in the process.

Promise<URI>

The URI of the document that has reached the desired state, or undefined if the document does not exist.

OperationCancelled if cancellation has been requested before the state has been reached

DefaultDocumentBuilder.waitUntil

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.