Skip to content

Commit

Permalink
Hide commands intended as command variables
Browse files Browse the repository at this point in the history
The commands `bazel.info.*` and `bazel.getOutputPath` are intended to be
used as command variables within `launch.json` and `task.json`. For
additional context, see  bazel-contrib#273, bazel-contrib#275 and bazel-contrib#291.

Those commands are not intended to be called by users directly. As such,
they should not show up in the command palette. Calling them from the
command picker has no user-visible effect and leaves the user with the
impression that those commands would be broken.

This commit removes them from the `commands` contribution point, thereby
hiding them from the command picker. To make sure that the extension is
loaded as soon as some `task.json`/`launch.json` invokes any of those
commands, they now need to be registered as `activationEvents`, since VS
Code will no longer discover those events automatically from the
`commands` contributions.
  • Loading branch information
vogelsgesang committed Feb 27, 2024
1 parent 15793a4 commit c61cde6
Showing 1 changed file with 8 additions and 36 deletions.
44 changes: 8 additions & 36 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@
"workspaceContains:**/WORKSPACE",
"workspaceContains:**/WORKSPACE.bazel",
"workspaceContains:**/MODULE.bazel",
"workspaceContains:**/REPO.bazel"
"workspaceContains:**/REPO.bazel",
"onCommand:bazel.getTargetOutput",
"onCommand:bazel.info.bazel-bin",
"onCommand:bazel.info.bazel-genfiles",
"onCommand:bazel.info.bazel-testlogs",
"onCommand:bazel.info.execution_root",
"onCommand:bazel.info.output_base",
"onCommand:bazel.info.output_path"
],
"main": "./out/src/extension/extension",
"contributes": {
Expand Down Expand Up @@ -90,41 +97,6 @@
"command": "bazel.copyTargetToClipboard",
"title": "Copy Label to Clipboard"
},
{
"category": "Bazel",
"command": "bazel.getTargetOutput",
"title": "Get output path for the given target"
},
{
"category": "Bazel",
"command": "bazel.info.bazel-bin",
"title": "Get bazel-bin value"
},
{
"category": "Bazel",
"command": "bazel.info.bazel-genfiles",
"title": "Get bazel-genfiles value"
},
{
"category": "Bazel",
"command": "bazel.info.bazel-testlogs",
"title": "Get bazel-testlogs value"
},
{
"category": "Bazel",
"command": "bazel.info.execution_root",
"title": "Get Bazel execution_root value"
},
{
"category": "Bazel",
"command": "bazel.info.output_base",
"title": "Get Bazel output_base value"
},
{
"category": "Bazel",
"command": "bazel.info.output_path",
"title": "Get Bazel output_path value"
},
{
"category": "Bazel",
"command": "bazel.lsp.restart",
Expand Down

0 comments on commit c61cde6

Please sign in to comment.