Bug Report T475395
Visible to All Users

Refactorings - Split Conditional - Comments above the if statement are removed after applying Split Conditional refactoring

created 8 years ago

Attempting to use "Split Conditional" deletes comments right in front of the conditional expression, which is something that should probably not happen.

Given the following sample code:

C#
int i = 42; // check for numbers between 1 and 299 to... if (i > 0 && i < 300) { }

Placing the cursor on the && and invoking "Split Conditional" causes the following code to be generated:

C#
int i = 42; if (i > 0) if (i < 300) { }

The preview window even shows the comment being deleted, but it doesn't really make sense.
I'd expect the comment to stay where it is.

Comments (1)
DevExpress Support Team 8 years ago

    Emanuel,

    Thank you for your report, I agree with you that this can be improved. I have passed this ticket to our developers for fixing.

    Answers approved by DevExpress Support

    created 8 years ago

    We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

    Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

      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.