Ticket T653640
Visible to All Users

Wrong code formatting when using regions

created 7 years ago

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

Comments (1)
DevExpress Support Team 7 years ago

    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.

    Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

    Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.