fix(lsp): include cancellable in progress message table (#18809)

Currently the `title`, `message` and `percentage` is stored for a
progress, but there is also an optional `cancellable` that comes in with
both the `WorkDoneProgressBegin` and also `WorkDoneProgressReport`. This
change also stores that value so that a plugin can access it when they
do a lookup in `client.messages`.
This commit is contained in:
Chris Kipp
2022-05-31 13:19:45 +02:00
committed by GitHub
parent bfc85eab12
commit 1a20aed3fb

View File

@@ -40,10 +40,12 @@ local function progress_handler(_, result, ctx, _)
if val.kind == 'begin' then
client.messages.progress[token] = {
title = val.title,
cancellable = val.cancellable,
message = val.message,
percentage = val.percentage,
}
elseif val.kind == 'report' then
client.messages.progress[token].cancellable = val.cancellable
client.messages.progress[token].message = val.message
client.messages.progress[token].percentage = val.percentage
elseif val.kind == 'end' then