Langium - v4.0.0
    Preparing search index...

    Interface AsyncParser

    Async parser that allows cancellation of the current parsing process.

    The sync parser implementation is blocking the event loop, which can become quite problematic for large files. The default implementation is not actually async. It just wraps the sync parser in a promise. A real implementation would create worker threads or web workers to offload the parsing work.

    interface AsyncParser {
        parse<T extends AstNode>(
            text: string,
            cancelToken: Cancellation.CancellationToken,
        ): Promise<ParseResult<T>>;
    }

    Implemented by

    Index

    Methods

    Methods