JetBrains / JetBrains/resharper-unity

Settings > Code Style > C# > Other > Unity > Force a line break after any [Header] annotations does not work properly with properties.

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

Description

### With Serialized Variables
**Before formatting:**
![image](https://github.com/JetBrains/resharper-unity/assets/39038511/ae31ec39-c38f-41c2-b715-9217017c791b)
**After formatting:**
![image](https://github.com/JetBrains/resharper-unity/assets/39038511/405c4ac2-2a9a-4ba3-ac22-3526a91a302c)
**What I expect to happen:**
For the property to be on the same line as the SerializeField attribute.

### Without Serialization
**Before formatting:**
![image](https://github.com/JetBrains/resharper-unity/assets/39038511/5dccc2fd-8b54-41fb-861f-9436aad7d245)
**After formatting:**
![image](https://github.com/JetBrains/resharper-unity/assets/39038511/08f4c4e3-bc02-431f-af5d-74266339ffcb)
**What I expect to happen:**
For the property to be on the line after the Header attribute.

### Version Information:
Unity version 6000.0.4f1 | Unity Package JetBrains Rider Editor version 3.0.28 | JetBrains Rider version 2024.1.3

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue using the Settings > Code Style > C# > Other > Unity > Force a line break after any [Header] annotations option, with both serialized and non-serialized properties. Compare the formatting with the expected placement relative to [Header] and [SerializeField], and consider the issue complete when both examples format as described.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, unity
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.