C# Code fields with attributes formatting and file Headers?
Hi I have two questions.
The first one is formatting fields with attributes. I would need a way to prevent Rider from formatting them.
For example I would like this:
[Tooltip("The ID of the Definition.")]
[SerializeField] protected uint m_ID;
[Tooltip("The category of this definition, it defines all the attributes this definition should have and more.")]
[SerializeField] protected ItemCategory m_Category;
But instead I get this:
[Tooltip("The ID of the Definition.")]
[SerializeField] protected uint m_ID;
[Tooltip(
"The category of this definition, it defines all the attributes this definition should have and more.")]
[SerializeField] protected ItemCategory m_Category;
Apart from that I need to add a Header to all the files in my project with a summary of the project licence. There seems to be an option for the Code cleanup to automatically add THE "Header", but I can't find anywhere I can set that "Header" they are talking about.
Thank you for your time
Please sign in to leave a comment.
Hi,
To achieve the desired formatting, go to `File | Settings | Editor | Code Style | C#`, open "Blank lines" tab and set "Blank lines in declarations -> Around field" to 0.
As for the file header, Rider doesn't have UI for editing it, unfortunately. Please take a look at this comment for the workaround.
Hope this helps! Please let me know if you have any questions.