When gopls starts to execute go generate, it sends a ShowMessageRequest to the client so the client can present a dialog to the user. That dialog includes an action, Cancel, to let the user cancel go generate before it's done.
Using a WorkDoneToken in the ExecuteCommand request is the only way I found to tie the dialog to a specific execution. If it can't be tied to that specific execution there is no way to know when the dialog should be automatically closed (i.e. when go generate is done and Cancel isn't a valid action anymore).
ShowMessageRequest isn't sent when WorkDoneProgress is supported by the client, so this isn't as urgent as I initially thought. The entire lifetime can be traced using progress callbacks only, even though they can't be linked to a specific command execution.
Our WorkDone reporting was generating a random token for each unit of
work, even if a token was supplied by the client. Change this to use
the client token if it is non-empty, and skip the
After this change we can no longer rely on tokens being a string.
Update our progress tracking accordingly.
Run-TryBot: Robert Findley <firstname.lastname@example.org>
TryBot-Result: Gobot Gobot <email@example.com>
Reviewed-by: Rebecca Stambler <firstname.lastname@example.org>