Skip to content

lspeasy / core/src / createIncrementalDidChangeParams

Function: createIncrementalDidChangeParams()

ts
function createIncrementalDidChangeParams(
   uri, 
   changes, 
   source): DidChangeTextDocumentParams;

Defined in: packages/core/src/utils/document.ts:147

Builds DidChangeTextDocumentParams for an incremental (range-based) document change notification.

Parameters

ParameterTypeDescription
uristringThe document URI.
changesIncrementalChange[]One or more range-based text changes.
sourceVersionSourceEither an explicit version number or a tracker instance.

Returns

DidChangeTextDocumentParams

A DidChangeTextDocumentParams ready to send.

Remarks

Use when the client tracks individual edits (e.g. single-character insertions, deletions) rather than sending the full document text on each change. Requires the server to have textDocumentSync.change = Incremental.

Throws

If neither version nor tracker is provided.

Released under the MIT License.