Protected
Readonly
fileProtected
Readonly
serviceProtected
Optional
Readonly
textProtected
createOptional
options: ParserOptionsProtected
createProtected
createCreate a LangiumDocument from a given parse result.
A TextDocument is created on demand if it is not provided as argument here. Usually this should not be necessary because the main purpose of the TextDocument is to convert between text ranges and offsets, which is done solely in LSP request handling.
With the introduction of update below this method is supposed to be mainly called during workspace initialization and on addition/recognition of new files, while changes in existing documents are processed via update.
Optional
textDocument: TextDocumentOptional
text: stringProtected
createOptional
text: stringCreate an Langium document from a model that has been constructed in memory.
Create an Langium document from an in-memory string.
Optional
options: ParserOptionsCreate an Langium document from an in-memory string.
Create a Langium document from a TextDocument
(usually associated with a file).
Optional
uri: URIOptional
options: ParserOptionsCreate a Langium document from a TextDocument
(usually associated with a file).
Create an Langium document from a specified URI
. The factory will use the FileSystemAccess
service to read the file.
Protected
parseOptional
options: ParserOptionsProtected
parseUpdate 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!