vscode-csharp icon indicating copy to clipboard operation
vscode-csharp copied to clipboard

Attribute formatting for fields on multiple lines

Open RedSray opened this issue 6 years ago • 1 comments

Issue Description

I have a problem with a specific formatting. I use CSharp attribute on certain fields and I want them to be on the same line. Everything is fine until my field declaration needs to be wrap on a second line. When this happen the formatter force the attribute above the field

Steps to Reproduce

  • Declare a field with an attribute
  • Wrap the declaration on a second line
  • Trigger the formatter

Expected Behavior

The formatter keep the attribute on the first line of the field declaration image

Actual Behavior

The formatter put the attribute above the first line of the field declaration image

RedSray avatar Dec 03 '20 12:12 RedSray

O# uses the Roslyn Formatter which can be configured by an .editorconfig. See details at https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options

If there is a particular formatting configuration you are looking for but with no option, you can open a feature request at https://github.com/dotnet/roslyn/issues

JoeRobich avatar Nov 12 '24 22:11 JoeRobich