Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bazel.info.* commands #291

Merged
merged 1 commit into from
Dec 14, 2022
Merged

Add bazel.info.* commands #291

merged 1 commit into from
Dec 14, 2022

Conversation

jfirebaugh
Copy link
Collaborator

I proposed these originally in #273 as an initial idea for what became #275. But I have encountered another use case that makes me think they are generally useful:

When debugging on macOS, lldb needs to be configured with the command platform settings -w $execution_root, where $execution_root is what's returned by bazel info execution_root. With bazel.info.* commands, you can create a launch configuration that contains:

      "initCommands": [
        "platform settings -w ${command:bazel.info.execution_root}",
      ]

@jfirebaugh jfirebaugh merged commit d5ad3e9 into master Dec 14, 2022
@jfirebaugh jfirebaugh deleted the jfirebaugh/info-commands branch December 14, 2022 16:34
vogelsgesang added a commit to vogelsgesang/vscode-bazel that referenced this pull request Feb 27, 2024
The commands `bazel.info.*` and `bazel.getOutputPath` are intended to be
used by the 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 picker. This commit removes them
from the `commands` contribution point, thereby hiding them from the
command picker.
vogelsgesang added a commit to vogelsgesang/vscode-bazel that referenced this pull request Feb 27, 2024
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.
cameron-martin pushed a commit that referenced this pull request Feb 28, 2024
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.
vogelsgesang added a commit to vogelsgesang/vscode-bazel that referenced this pull request Feb 29, 2024
Not sure why this wasn't added initially in bazel-contrib#291. Maybe the assumption
was that the workspace root is already available through VS Code's
`${workspaceFolder}`. However, that represents the place where VS Code
was opened. The Bazel workspace folder might be further up in the
directory tree.
vogelsgesang added a commit to vogelsgesang/vscode-bazel that referenced this pull request Feb 29, 2024
Not sure why this wasn't added initially in bazel-contrib#291. Maybe the assumption
was that the workspace root is already available through VS Code's
`${workspaceFolder}`. However, that represents the place where VS Code
was opened. The Bazel workspace folder might be further up in the
directory tree.
cameron-martin pushed a commit that referenced this pull request Feb 29, 2024
Not sure why this wasn't added initially in #291. Maybe the assumption
was that the workspace root is already available through VS Code's
`${workspaceFolder}`. However, that represents the place where VS Code
was opened. The Bazel workspace folder might be further up in the
directory tree.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants