Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VS Code: use
enablement
for Cody commands (#4155)
- The `when` configuration field is not applicable to commands: - To verify disable autocomplete and observe that all autocomplete commands are still visible in the command list. - The related JSON schema in VS Code sources confirms this: https://github.com/microsoft/vscode/blob/29aeab1cbb350107a7bd5962b5e7efe745e0a3ec/src/vs/workbench/services/actions/common/menusExtensionPoint.ts#L729-L773. The `when` field is missing. Only `enablement` is specified. - The VS Code document is misleading: https://code.visualstudio.com/api/extension-guides/command#controlling-when-a-command-shows-up-in-the-command-palette - This PR changes all `when` fields to `enablement` to hide Cody commands under certain conditions. - **Design input required**: we use `"cody.activated && editorTextFocus"` in multiple places. It does nothing in the current version of the extension, but with the `enablement` field, it hides the respective command from the quick pick menu (shift+command+P) even when it's opened from the editor. Technically, the editor is not focused anymore; the quick menu is. So this configuration can be treated as: "the command will be hidden from the commands list, but will be available via keybindings if `editorTextFocus`". - Related discussion: microsoft/vscode#124755.
- Loading branch information
1 parent
15c2357
commit 69aec78
Showing
2 changed files
with
44 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters