JetBrains / JetBrains/resharper-unity
Warn if ExecuteAlways is applied to class with wrong base type
- Dominant language
- C#
- Stars
- 1.2k
- Forks
- 142
- PR merge metrics
- No merged PRs in 30d
Description
`[ExecuteAlways]` can be applied to `MonoBehaviour` based classes, so is a good candidate for the `[BaseTypeRequired]` annotation. However, it can also be applied to `SystemBase` classes.
`BaseTypeRequired` can only suggest a single base class (with multiple interfaces). Add a warning to suggest deriving from `MonoBehaviour` or `SystemBase`, with quick fix.
Note:
> ComponentSystemBase would be a better test since that would also cover ComponentSystem and JobComponentSystem variants
Contributor guide
Research direction
Locate the inspection and quick-fix handling for ExecuteAlways and the existing BaseTypeRequired annotation support. Use ComponentSystemBase as the test case, covering MonoBehaviour and SystemBase alternatives; done means an incorrect base type produces a warning with a quick fix suggesting either valid base class.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, unity
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100