Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add attribute target usage annotations #247

Merged
merged 3 commits into from
Nov 8, 2017

Conversation

citizenmatt
Copy link
Member

Some Unity attributes don't set AttributeTargets, put they can only realistically be applied to certain targets. This adds the targets in as external annotations - ReSharper treats this as though they were "real" and shows a warning if the attributes are applied to the wrong target type.

@citizenmatt citizenmatt added this to the Rider 2017.3 milestone Oct 10, 2017
@citizenmatt citizenmatt self-assigned this Oct 10, 2017
@citizenmatt
Copy link
Member Author

Let me know when it's good to merge, and where to merge to - this isn't required for Rider 2017.2

Copy link
Collaborator

@IvanPashchenko IvanPashchenko left a comment

Choose a reason for hiding this comment

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

@IvanPashchenko IvanPashchenko merged commit ad55d13 into master Nov 8, 2017
@IvanPashchenko IvanPashchenko deleted the feature/external_annotations branch November 8, 2017 14:23
@mmechtley
Copy link

Currently (2.1.3.4269) the severity of this inspection is not exposed in the UI and defaults to Error. We'd like the ability to downgrade this since it's not actually something that will break builds, just an improper use case.

@citizenmatt
Copy link
Member Author

Yep. It's confusing that it's marked as an error when it compiles, although we do sometimes mark things that result in a runtime failure as an error, and this does fit into that category (e.g. a property marked with [SerializeField] won't serialise) and it should be fixed.

But we're going to change it to display as redundant code (greyed out), as they can technically be applied, but they won't do anything. See #325.

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

Successfully merging this pull request may close these issues.

3 participants