Skip to content

Add a TargetKind for annotations on imports, exports, and part directives. #52274

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

Closed
natebosch opened this issue May 5, 2023 · 1 comment
Closed
Labels
devexp-pkg-meta Issues related to package:meta legacy-area-analyzer Use area-devexp instead. P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug

Comments

@natebosch
Copy link
Member

This might be blocked on changing TargetKind into a class with static constants instead of an enum as discussed in #49796

The recommended pattern for using @GenerateNiceMocks from package:mockito is to annotate the import of the generated file. This is a pattern we are likely to repeat into other packages.

It would be great if we can statically require the annotation on an import or export. I think it could be fine to have a single TargetKind.directive, but it may be more useful to split it up into imports, exports, and parts.

@natebosch natebosch added legacy-area-analyzer Use area-devexp instead. devexp-pkg-meta Issues related to package:meta labels May 5, 2023
@bwilkerson bwilkerson added the P3 A lower priority bug or feature request label May 5, 2023
@matanlurey
Copy link
Contributor

If you did a bit mask you could do something cute like:

static const anyDirective = TargetKind.importDirective | TargetKind.exportDirective | ...

@srawlins srawlins added the type-enhancement A request for a change that isn't a bug label Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devexp-pkg-meta Issues related to package:meta legacy-area-analyzer Use area-devexp instead. P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants