Tokenizes the current [[Document Document]] in the background, and caches the tokenized rows for future use.

If a certain row is changed, everything below that row is re-tokenized.

Constructors

  • Creates a new BackgroundTokenizer object.

    Parameters

    • tokenizer: Tokenizer

      The tokenizer to use

    • Optional session: EditSession

      The editor session to associate with

    Returns BackgroundTokenizer

Properties

$worker: (() => void)

Type declaration

    • (): void
    • Returns void

currentLine: number
doc: Document
lines: any[]
running: number | false
states: any[]
tokenizer: Tokenizer

Methods

  • Emits the 'update' event. firstRow and lastRow are used to define the boundaries of the region to be updated.

    Parameters

    • firstRow: number

      The starting row region

    • lastRow: number

      The final row region

    Returns void

  • Returns the state of tokenization at the end of a row.

    Parameters

    • row: number

      The row to get state at

    Returns string

  • Gives list of [[Token]]'s of the row. (tokens are cached)

    Parameters

    • row: number

      The row to get tokens at

    Returns Token[]

  • Sets a new document to associate with this object.

    Parameters

    • doc: Document

      The new document to associate with

    Returns void

  • Starts tokenizing at the row indicated.

    Parameters

    • startRow: number

      The row to start at

    Returns void

Generated using TypeDoc