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 Target annotations to annotation classes #1345

Merged
merged 1 commit into from
Sep 18, 2020
Merged

Add Target annotations to annotation classes #1345

merged 1 commit into from
Sep 18, 2020

Conversation

natebosch
Copy link
Member

This will allow the analyzer to emit diagnostics when the annotations
are used in places where they will not be honored by the test runner.
When used as annotations (as opposed to arguments to test or group)
the test runner only looks at the library level and all annotations
apply to an entire test suite.

This will allow the analyzer to emit diagnostics when the annotations
are used in places where they will not be honored by the test runner.
When used as annotations (as opposed to arguments to `test` or `group`)
the test runner only looks at the library level and all annotations
apply to an entire test suite.
@jakemac53
Copy link
Contributor

Does this still allow annotations on the first directive in the file? That is actually what is supported by the test package.

@natebosch
Copy link
Member Author

Does this still allow annotations on the first directive in the file? That is actually what is supported by the test package.

Yes it does. https://pub.dev/documentation/meta/latest/meta_meta/TargetKind-class.html

Indicates that an annotation is valid on the first directive in a library, whether that's a library, import, export or part directive. This doesn't include the part of directive in a part file.

Copy link
Contributor

@jakemac53 jakemac53 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@natebosch natebosch merged commit 344b3cd into master Sep 18, 2020
@natebosch natebosch deleted the target-kind branch September 18, 2020 17:27
natebosch added a commit that referenced this pull request May 23, 2022
Closes dart-lang/sdk#49071

Add a `Target` with the `TargetKind.library` so that the analyzer
understands that the annotation is logically applied to the library,
even when it is syntactically applied on an import. This fixes behavior
when sorting imports.
The same configuration was applied to other imports in #1345 and this
looks like it was an accidental omission.
natebosch added a commit that referenced this pull request May 24, 2022
Closes dart-lang/sdk#49071

Add a `Target` with the `TargetKind.library` so that the analyzer
understands that the annotation is logically applied to the library,
even when it is syntactically applied on an import. This fixes behavior
when sorting imports.
The same configuration was applied to other imports in #1345 and this
looks like it was an accidental omission.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants