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

[Feature request] Add option to filter CodeLens links in BUILD files #300

Open
rossc719g opened this issue Jul 21, 2023 · 2 comments
Open

Comments

@rossc719g
Copy link

TL;DR: It would be really nice to have a way to filter the displayed CodeLens links.

In BUILD files, there are often extra hidden rules defined by rules.

For example, if you use:

load("@bazel_skylib//rules:build_test.bzl", "build_test")

build_test(
  name="foo"
  ...
)

You get the expected Test //whatever:foo link, but you also get Build //whatever:foo_0__deps.

And if you have functions in a .bzl file that create multiple sub-rules, the list of links can quickly get very long, and end up wider than the available space, and the UI does not let you scroll right if your file content is not that wide.
(Incidentally, it would be nice to wrap these long lines of links, but that is a separate FR)

Ideally, it would just honor the existing Bazel › Command Line: Query Expression option for these links as well.
But it would be fine to have a similar option specifically for the CodeLens links if that is deemed to be nicer.

Thoughts?

@cameron-martin cameron-martin changed the title [Feature request] Add option to filer CodeLens links in BUILD files [Feature request] Add option to filter CodeLens links in BUILD files Jan 23, 2024
@KrauseStefan
Copy link

This would be really nice to have both for the CodeLens links but also for the side bar tree.

The Idea plugin has this trough the no-ide tag.
https://ij.bazel.build/docs/tags.html#no-ide

Something similar could be very nice.
Alternatively just a setting to add filter by name.

What something like this be a welcome change for the maintainers?

@vogelsgesang
Copy link
Collaborator

vogelsgesang commented Apr 25, 2024

This would be really nice to have both for the CodeLens links but also for the side bar tree.
[...]
Alternatively just a setting to add filter by name.

For the side bar / the "Bazel Build Targets" tree, there is already the setting bazel.commandLine.queryExpression.
I guess you could write a Bazel query to filter out no-ide tagged targets?

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

No branches or pull requests

3 participants