TypeQLiteDocumentBuilder
Defined in: libs/language/src/typeqlite-label-providers.ts:218
Relinks a document that holds labels whenever any document changes.
Extends
Section titled “Extends”Member summary
Section titled “Member summary”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. |
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new TypeQLiteDocumentBuilder(
services):TypeQLiteDocumentBuilder
Defined in: node_modules/langium/lib/workspace/document-builder.d.ts:138
Parameters
Section titled “Parameters”services
Section titled “services”Returns
Section titled “Returns”TypeQLiteDocumentBuilder
Inherited from
Section titled “Inherited from”DefaultDocumentBuilder.constructor
Properties
Section titled “Properties”updateBuildOptions
Section titled “updateBuildOptions”updateBuildOptions:
BuildOptions
Defined in: node_modules/langium/lib/workspace/document-builder.d.ts:124
The options used for rebuilding documents after an update.
Inherited from
Section titled “Inherited from”DefaultDocumentBuilder.updateBuildOptions
Methods
Section titled “Methods”build()
Section titled “build()”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.
Type Parameters
Section titled “Type Parameters”T extends AstNode
Parameters
Section titled “Parameters”documents
Section titled “documents”LangiumDocument<T>[]
Set of documents to be built.
options?
Section titled “options?”Options for the document builder.
cancelToken?
Section titled “cancelToken?”CancellationToken
Indicates when to cancel the current operation.
Returns
Section titled “Returns”Promise<void>
Throws
Section titled “Throws”OperationCanceled if a user action occurs during execution
Inherited from
Section titled “Inherited from”DefaultDocumentBuilder.build
onBuildPhase()
Section titled “onBuildPhase()”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.
Parameters
Section titled “Parameters”targetState
Section titled “targetState”callback
Section titled “callback”Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”DefaultDocumentBuilder.onBuildPhase
onDocumentPhase()
Section titled “onDocumentPhase()”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:
- 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.
- The DocumentBuilder ensures that all DocumentPhaseListener instances are called for a built document. Even if the build is cancelled before those listeners were called.
Parameters
Section titled “Parameters”targetState
Section titled “targetState”callback
Section titled “callback”Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”DefaultDocumentBuilder.onDocumentPhase
onUpdate()
Section titled “onUpdate()”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.
Parameters
Section titled “Parameters”callback
Section titled “callback”Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”DefaultDocumentBuilder.onUpdate
resetToState()
Section titled “resetToState()”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.
Type Parameters
Section titled “Type Parameters”T extends AstNode
Parameters
Section titled “Parameters”document
Section titled “document”The document to reset.
The state to reset the document to.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”DefaultDocumentBuilder.resetToState
update()
Section titled “update()”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.
Parameters
Section titled “Parameters”changed
Section titled “changed”URI[]
URIs of changed or created documents
deleted
Section titled “deleted”URI[]
URIs of deleted documents
cancelToken?
Section titled “cancelToken?”CancellationToken
allows to cancel the current operation
Returns
Section titled “Returns”Promise<void>
Throws
Section titled “Throws”OperationCancelled if cancellation is detected during execution
Inherited from
Section titled “Inherited from”DefaultDocumentBuilder.update
waitUntil()
Section titled “waitUntil()”Call Signature
Section titled “Call Signature”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.
Parameters
Section titled “Parameters”The desired state. The promise won’t resolve until all documents have reached this state
cancelToken?
Section titled “cancelToken?”CancellationToken
Optionally allows to cancel the wait operation, disposing any listeners in the process
Returns
Section titled “Returns”Promise<void>
Throws
Section titled “Throws”OperationCancelled if cancellation has been requested before the state has been reached
Inherited from
Section titled “Inherited from”DefaultDocumentBuilder.waitUntil
Call Signature
Section titled “Call Signature”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.
Parameters
Section titled “Parameters”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.
cancelToken?
Section titled “cancelToken?”CancellationToken
Optionally allows to cancel the wait operation, disposing any listeners in the process.
Returns
Section titled “Returns”Promise<URI>
The URI of the document that has reached the desired state, or undefined if the document does not exist.
Throws
Section titled “Throws”OperationCancelled if cancellation has been requested before the state has been reached
Inherited from
Section titled “Inherited from”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.