Skip to content

lspeasy / core/src / createProgressBegin

Function: createProgressBegin()

ts
function createProgressBegin(
   title, 
   cancellable?, 
   message?, 
   percentage?): WorkDoneProgressBegin;

Defined in: packages/core/src/protocol/progress.ts:52

Creates a WorkDoneProgressBegin payload to start a work-done progress notification.

Parameters

ParameterTypeDescription
titlestringShort, human-readable title for the progress operation (required).
cancellable?booleanWhether the client should offer a cancel button.
message?stringOptional initial status message shown below the title.
percentage?numberOptional initial progress percentage (0–100).

Returns

WorkDoneProgressBegin

A WorkDoneProgressBegin object ready to send as $/progress.

Remarks

Send this as the value of a $/progress notification after creating a progress token with window/workDoneProgress/create. The title is always displayed; message overrides the title for the first intermediate status text. Set cancellable: true only when the server can honour a $/cancelRequest for the underlying operation — clients use this to show a cancel button.

Released under the MIT License.