Create an Langium document from a model that has been constructed in memory.
Create an Langium document from an in-memory string.
Optional
options: ParserOptionsCreate a Langium document from an in-memory string asynchronously. This action can be cancelled if a cancellable parser implementation has been provided.
Create a Langium document from a TextDocument
(usually associated with a file).
Optional
uri: URIOptional
options: ParserOptionsCreate a Langium document from a TextDocument
asynchronously. This action can be cancelled if a cancellable parser implementation has been provided.
Create an Langium document from a specified URI
. The factory will use the FileSystemAccess
service to read the file.
Optional
cancellationToken: CancellationTokenUpdate the given document after changes in the corresponding textual representation. Method is called by the document builder after it has been requested to build an existing document and the document's state is DocumentState.Changed. The text parsing is expected to be done the same way as in fromTextDocument and fromString.
Shared service for creating
LangiumDocument
instances.Register a custom implementation if special (additional) behavior is required for your language(s). Note: If you specialize fromString or fromTextDocument you probably might want to specialize update, too!