Class DefaultLangiumDocumentFactory

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!

Implements

Constructors

Properties

fileSystemProvider: FileSystemProvider
serviceRegistry: ServiceRegistry
textDocuments?: TextDocumentProvider

Methods

  • Create 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.

    Type Parameters

    Parameters

    Returns LangiumDocument<T>