Skip to content

public SerializeField with private set is marked as unused #2319

@leohilbert

Description

@leohilbert

Hi, I spent some time searching through existing tickets, but didn't find an open issue for this yet. I hope I didn't miss one!

Unity supports to add a public property where the internal field is marked as a "SerializeField". That way you don't need to create a backing field and save one line. 🎉
image

This would be equal to

[SerializeField] private ConPlayerParentController playerParent;
public ConPlayerParentController PlayerParent => playerParent;

However Riders marks the "private set;" as unused, although Unity uses it, because it's a SerializeField.
Would be great if that would be fixed, or if there's a way to manually tell rider to ignore usage checks when a field is marked with "SerializeField".

Thanks! 😺

Edit: FormerlySerializedAs also doesn't seem to be added on renaming. 🤔

Rider Version 2022.1.1

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions