@alexandrudima I got the same question.
And is there a way to dispose added command ?
You could simply switch to addAction and also define a label. The only real difference is that the F1 list will then show your command, which is not that bad...
@alexdima What you prescribe won't work for code lens out of the box unless you created some other machinery.
I don't found a method to reject addCommand 锛宐ut I found it won't be called multiply by repeat define addCommandin a react hook. Was the addCommandjust like a Singleton? And I still want to know how to reject it.
The upcoming editor release will add monaco.editor.registerCommand to cover this usecase. (via https://github.com/microsoft/vscode/commit/7c937a7a383ca131c5e36811d4440878c97a1191)