JetBrains / JetBrains/resharper-unity

Add analysis for type passed to CustomPropertyDrawer

Open
#1,160 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
1.2k
Forks
142
PR merge metrics
No merged PRs in 30d

Description

The `[CustomPropertyDrawer(typeof(...))]` attribute sets the target type of the property or decorator drawer class it is being assigned to. There are requirements for the target type, as well as the base class of the custom drawer. Unity will silently ignore if these are set incorrectly (this needs testing).

* The target type must be run time serialisable class, or a class that derives from `PropertyAttribute`. If not, the drawer does nothing. Testing is required to see if "serialisable class" means only types marked with `[Serializable]` or also `MonoBehaviuour` based types.
* If the target type is a serializable type, the drawer type must be a `PropertyDrawer`, and not a `DecoratorDrawer`.

Contributor guide

Open the contributing guide

Research direction

Start at the Unity CustomPropertyDrawer attribute and investigate how its target type and drawer base class are currently handled. Add tests for serializable classes, PropertyAttribute targets, MonoBehaviour-based types, and the PropertyDrawer versus DecoratorDrawer requirements; done means invalid combinations are analyzed or explicitly covered by the tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, unity
Domain
testing-qa, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.