fix: limit command availability
This MR limits when is it possible to run a command. This will reduce bug reports and user confusion, because we won't even show commands if they can't be run.
Most of the commands should not be run if the extension
isn't in a valid state ("when": "gitlab:validState"
).
On top of that, commands that work on an open text editor make only sense when there is an open text editor "when": "gitlab:validState && editorIsOpen"
.
before | after | |
---|---|---|
no open workspace | ![]() |
![]() |
trying to insert snippet when there is no repository | ![]() |
![]() |
The following gif shows how we allow certain commands (e.g. insert snippet) only when there is an open editor.
Related to #377 (closed)