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

Gazelle: detect .go sources generated by custom rules and macros #654

Closed
jayconrod opened this issue Jul 26, 2017 · 1 comment
Closed

Gazelle: detect .go sources generated by custom rules and macros #654

jayconrod opened this issue Jul 26, 2017 · 1 comment

Comments

@jayconrod
Copy link
Contributor

Gazelle currently detects .go files mentioned by name in the out and outs attributes of rules in BUILD files. This is helpful but incomplete. If a project uses a rule that implicitly produces a .go file or uses a macro that hides the .go file name, Gazelle won't see it and won't include the files.

One possible solution is to ask Bazel what sources are produces by all rules in a package. This could be done with bazel query or using a custom aspect. This process may be slow if the Bazel server is not already running, so it may not be appropriate to run this from an editor save hook.

Another approach would be to add some custom directive to Gazelle, telling it what the generated .go files will be for a rule or macro of a given name. This would be faster, but it would require some developer customization.

@jayconrod
Copy link
Contributor Author

Migrated to bazelbuild/bazel-gazelle#14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant