Ticket S91822
Visible to All Users
Duplicate

We have closed this ticket because another page addresses its subject:

CodeGen - Add options to specify code generation rules

make 'block delimiter optimizing' configurable

created 17 years ago

Hi!
CodeRush and Refactor have the habit to remove the {} braces (e.g. when refactoring code),
if they are not necessary (only one statement).
But we have a coding policy to always use {} - so, is possible to configure this behaviour?
I posted in the forums
http://community.devexpress.com/forums/p/54296/183072.aspx
regarding this feature one year ago, and now I thought it would be a good idea to create an issue, so that I can track progress.
Frank

Show previous comments (4)
DevExpress Support Team 14 years ago

    Code providers should save the details of your code too.
    The issue with "Add else statement" is a bug and we have taken the liberty of creating a new issue on your behalf.
      Refactoring - The "Add Else Statement" refactoring removes curly braces from if statements
    Please refer to that ticket for further correspondence on this item.
    Thanks,
    Alex K

      Hi,
      i just noticed that the "flatten conditional" refactoring does not generate curly braces
      for the "return"-statement.
      Is there a setting in 11.2.5 to force the curly braces?
      Regards
      Frank

      DevExpress Support Team 14 years ago

        Hi Frank,
        The Code Formatting feature can't add new tokens (in this case curly braces) in the text. Therefore, adding this option is impossible.
        You can use the 'Force braces in "if…else" statement' rule of the Code Cleanup feature. This feature can be executed from 'DXCore Visualize' toolbar. You can learn more about it here: Code Cleanup.
        Thanks,
        Alex K

        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.