'File Layout: Matching field targeted attributes on auto-properties
In newer versions of Unity you can serialize the backing fields of properties via this pattern:
[field: SerializeField]
public Sprite Sprite { get; private set; }
Is there any way to specifically match on properties that have field targeted attributes in the File Layout settings of Rider? I've tried a few different things but none of them seem to result in a match:
<Entry DisplayName="Serialized Properties" Priority="150">
<Entry.Match>
<And>
<unity:SerializedField/>
<Kind Is="Autoproperty" />
</And>
</Entry.Match>
</Entry>
<Entry DisplayName="Serialized Properties" Priority="150">
<Entry.Match>
<And>
<HasAttribute Name="SerializeField"/>
<Kind Is="Autoproperty" />
</And>
</Entry.Match>
</Entry>
<Entry DisplayName="Serialized Properties" Priority="150">
<Entry.Match>
<And>
<HasAttribute Name="field: SerializeField"/>
<Kind Is="Autoproperty" />
</And>
</Entry.Match>
</Entry>
Solution 1:[1]
As of Rider 2022.1, the File Layout settings don't have a way of matching an auto property with a field: targeted attribute - the HasAttribute element will only match attributes that target the property itself. Here's an issue you can vote for and track: RSRP-488346.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | citizenmatt |
