Add Internal Command
There are cases where we need to add commands that VSCode recognizes, but not expose them to any of the VSCode's user facing UIs. Some good examples are Copy To Clipboard (Private), Convert Candidate Link (Private), and Note Lookup Autocomplete (Private)
When adding these kinds of commands, make sure to set the proper enablement clause for them so that they do not show up in the command palette or in the contextual menu.
To illustrate, CopyToClipboardCommand
is only used for simulating a button click within a rendered markdown preview, and the when
clause is set to false
.
Note that setting when
clauses do not stop you from executing this command through vscode.commands.executeCommand
or through a command URI. It just hides them from user facing UIs.
Backlinks