Skip to content

Commit

Permalink
Hide commands intended as command variables (#347)
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  #273, #275 and #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 authored Feb 28, 2024
1 parent 15793a4 commit 6d3e988
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 6d3e988

Please sign in to comment.