Hi
When using regions and code cleanup with code formatting as last step , the file is wrongly formatted: There is additional first line after the { which shouldn't be there and after the last #region directive one new line is missing.
The issue can be easily duplicated with any simple C# class with at least one class-level element (field, method, constructor, etc.) and with attached CRR settings.
Could you please check what is wrong?
Thank you,
Zvonko
Hi Zvonko,
Thank you for informing us about this problem.
I've reproduced it.
Zvonko, actually there are two different issues in your report.
The first one relates to the "Blank lines around" option for the region directive in the formatting options. When it is set, and the region is the first in the file, a blank line is added although it should not be.
The other issue relates to the interaction between the two settings in the Code Cleanup options: "Organize members" and "Format Document". Disabling any of them solves the problem.
For more convenience, I have divided these questions and created separate tickets for them.
- Code Formatting incorrectly works with regions when the "Organize members" option is set
- The "Blank line around" option incorrectly works for regions
We will process them shortly.