Skip to content

lspeasy / core/src / createProgressReport

Function: createProgressReport()

ts
function createProgressReport(
   message?, 
   percentage?, 
   cancellable?): WorkDoneProgressReport;

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

Creates a WorkDoneProgressReport payload to update an in-progress work-done notification.

Parameters

ParameterTypeDescription
message?stringUpdated status text; omit to keep the previous message.
percentage?numberUpdated progress percentage (0–100); omit for indeterminate.
cancellable?booleanWhether the cancel button should be shown/hidden.

Returns

WorkDoneProgressReport

A WorkDoneProgressReport object ready to send as $/progress.

Remarks

All parameters are optional. Omit message to keep the last displayed message; omit percentage when the operation does not have a measurable completion ratio. If cancellable changes between reports, the client will update the cancel button accordingly.

Released under the MIT License.