Skip to content

DiffPlugin

DiffPlugin = EditorPlugin & object

getExpandedRegions(): ReadonlySet<string>

§C5. Hosts must not mirror this.

ReadonlySet<string>

getRows(): readonly DiffRenderRow[]

readonly DiffRenderRow[]

getStackedRows(): readonly DiffRenderRow[]

Both sides in row order. Cached until the file or expansion state changes.

readonly DiffRenderRow[]

getTokens(): readonly EditorToken[]

readonly EditorToken[]

isSyntaxReady(): boolean

Projected syntax tokens for the current rows. The host passes them with the rows’ text, setText(text, { tokens }), or an expansion toggle repaints uncoloured (§C10).

boolean

onDidChangeRows(listener): EditorDisposable

() => void

EditorDisposable

onDidChangeTokens(listener): EditorDisposable

() => void

EditorDisposable

releaseSyntax(): void

Releases syntax interests while retaining this pane’s rows and shared expansion.

void

setBaseFile(file): void

overlay mode: the buffer the live editor text is diffed against.

DiffTextFile | null

void

setEnabled(enabled): void

boolean

void

setFile(file, prepared?): void

document mode: the file to project. The host owns the editor’s text — §C3. prepared streams from prepareDiffSyntax for this file paint with the first rows, and a preparation still running is awaited in place of a second parse. The plugin disposes each reader interest.

DiffFile | null

PreparedDiffSyntaxInput

void

toggleRegion(key): void

string

void