diff --git a/pkg/meta/CHANGELOG.md b/pkg/meta/CHANGELOG.md index c9c846153fa..2691028656a 100644 --- a/pkg/meta/CHANGELOG.md +++ b/pkg/meta/CHANGELOG.md @@ -2,6 +2,8 @@ - Introduce `TargetKind.constructor`, to indicate that an annotation is valid on any constructor. +- Introduce `TargetKind.directive`, to indicate that an annotation is valid on + any directive. - Introduce `TargetKind.typeParamteer`, to indicate that an annotation is valid on any type parameter. - Introduce `@doNotSubmit` to annotate members that should not be submitted to diff --git a/pkg/meta/lib/meta_meta.dart b/pkg/meta/lib/meta_meta.dart index f1de463ade6..b055ba56790 100644 --- a/pkg/meta/lib/meta_meta.dart +++ b/pkg/meta/lib/meta_meta.dart @@ -48,6 +48,11 @@ class TargetKind { /// because there is no way to annotate a primary constructor. static const constructor = TargetKind._('constructors', 'constructor'); + /// Indicates that an annotation is valid on any directive in a library or + /// part file, whether it's a `library`, `import`, `export`, `part`, or + /// `part of` directive. + static const directive = TargetKind._('directives', 'directive'); + /// Indicates that an annotation is valid on any enum declaration. static const enumType = TargetKind._('enums', 'enumType'); @@ -119,6 +124,7 @@ class TargetKind { static const values = [ classType, constructor, + directive, enumType, extension, extensionType,