Bug Report T574118
Visible to All Users

Organize Members - The Remove Existing Line Breaks option acts incorrectly with comments

created 7 years ago

Hi

Spotted another issue, given the below example code:

C#
namespace ConsoleApp1 { internal class test1 { private test1() { } } //internal class test2 //{ // private test2() { } //} internal class test3 { private test3() { } } }

As you can see the 2nd class is commented out (I personally don't put multiple classes in a file) but when I do a code clean up I get this result:

C#
namespace ConsoleApp1 { internal class test1 { private test1() { } } //internal class test2 //{ // private test2() { } //} internal class test3 { private test3() { } } }

if I press it a 2nd time, I get this:

C#
namespace ConsoleApp1 { internal class test1 { private test1() { } } //internal class test2 //{ // private test2() { } //} internal class test3 { private test3() { } } }

The more I press the clean up the more the middle commented out class gets messy.

I think this is to do with the organize members as I currently have the C#>Formatting>Blank Lines all turned off. as I use organize members to put in the blank lines.

Hope this helps.

Comments (3)
DevExpress Support Team 7 years ago

    Alan,

    I can see this issue if I check the "Remove existing line breaks" option in the organize members settings.
    Would you please clarify if you have this option enabled?
    It might be also very helpful if you can send your CodeRush settings.
    Click "CodeRush\Support\Setings Folder…" and archive the settings and attach them to this ticket.

    AM AM
    Alan Middleton999 7 years ago

      Hi Alex

      Yes I can confirm the "Remove existing line breaks" is ON , turning this off solves the issue, but then the extra lines won't get removed. So the issue is something to do with this option.

      I've attached my current settings file for you. Zipped up .

      DevExpress Support Team 7 years ago

        Alan,

        Thank you for the confirmation, please give us some time to find a solution to this issue.

        Answers approved by DevExpress Support

        created 7 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.