Open jceipek opened 7 years ago
Hi @jceipek. Yes, this repros with Roslyn outside Visual Studio Code.
Is it the splitting of attributes onto individual lines that's bothering you, or the moving of the variable declaration below the attributes (not in-line with [CurveRange])? If it's the former, you can use the [SerializeField, CurveRange]
syntax instead and the formatter will leave them together.
Thanks for checking @dpoeschl!
It's the moving of the variable declaration away from the line with attributes that bothers me. In Unity projects using C#, there are often many variables with multiple attributes in the same file, and I'd like to be able to read them all without scrolling vertically or horizontally while keeping variables visually associated with the attributes that affect their behavior.
If I use the comma syntax it is a bit better, but it's still visually harder to make this association than if the formatting were maintained.
Since #11685 was intended to "Keep attribute on the same line as a member if they started on a single line," (which is what I want) the current behavior seems like a bug to me.
Yes, it does seem like a regression from the issue/PR you point out.
This issue has been fixed by #22192, hasn't it? Why is it still open?
This is probably related to #11685 and is the one thing keeping me from switching to formatting on save.
Version Used: Visual Studio Code 1.15.1 with the extension "C# for Visual Studio Code (powered by OmniSharp) v 1.21.1"
I could be mistaken, but I think roslyn provides the underlying formatting engine for the extension; please let me know if that isn't the case.
To Reproduce: Format a file that includes a member with multiple attributes, such as this:
Expected Formatting Result:
Actual Formatting Result: