Ticket S136340
Visible to All Users

Alternate expansion for Setter Guard and such?

created 15 years ago

Greetings.
My company's current coding guidelines require single method exit points, thus no calling "return" until the end of the method body. Some CodeRush/Refactor! Pro expansions result in code like:
**********
if (_currentFilename == value)
    return;
**********
(this example is generated by Introduce Setter Guard Clause, but I believe that there are also others)
My code guidelines would require this instead:
**********
if (_currentFilename != value)
{
    // embedded code
}
**********
I'd like to request either (or both):
- A refactoring to reverse a conditional and replace "return" with a code block.
and/or
- an option for choosing how these sort of blocks are expanded (choose "return" or an embedding code block).
Thanks!

Comments (1)
DevExpress Support Team 15 years ago

    Hi Robert,
    Currently we don't support inserting code blocks for refactorings and code providers. But, our team has started implementing suggestion CodeGen - Add options to specify code generation rules and in v2011 vol 1 release it should be available.
    And now you can insert code block for selection. See Embed Selection. To generate blocks around selection you can use the "B" shortcut by default.
    Thanks,
    Andrew

    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.