Bug Report T1005981
Visible to All Users

Organize Members - The indent for parameters is wrongly changed

created 4 years ago (modified 4 years ago)

I'm having problems with Organize Members feature of CodeRush for Roslyn reformatting some of the wrapped parameters for methods, and some type constraints for generic type parameters.

It only happens with the first member in a region and some random type constraints. I haven't discovered the trigger to make it reproducible for the type constraints, but once it starts removing the indention, it keeps doing it. For methods, it seems to be reproducible if the method returns a generic type and is the first member in a region. Code will start out like the first screenshot and after each call to Organize Members (called on file save), the wrapped parameters lose a level of indention, finally ending up like the second screenshot.

I have tried to mess with the formatting features of CodeRush to fix the wrapping, but that introduces other problems as Object Initializers are forced to have extra levels of indentation, even when turned off.

I would like to be able to use Organize Members and have the wrapped parameters not re-formatted when it runs.

Comments (3)
DevExpress Support Team 4 years ago

    Hi Ben,

    Thank you for contacting us.
    I've tried to reproduce the problem but did not face the behavior you describe.
    Here is a video illustrating my attempts.

    Could you please send us a single code file where you see this problem?
    Also, please send us your CodeRush settings from the following location: %AppData%\CodeRush\Settings\ and solution settings from the .cr folder, which is located near the solution file (if this folder exists). We will try to recreate the same conditions as yours.

      Thanks, Eugene. Sorry for the delay; time off got in the way.

      Here are the requested personal and solution settings.

      The example file attached displays the formatting issue; if you indent lines 21-25 with the parameters, saving will un-indent them one to two levels each time until they are left-aligned to the file.

      Thanks again for the help.

      DevExpress Support Team 4 years ago

        Hi Ben,
        Thank you for the CodeRush settings and CodeRushFormatting.cs file.
        I have reproduced the problem on my side. We will research the problem and try to find way to fix it. We cannot guarantee that we will solve the issue, because it's related with a wide interaction of CodeRush and Visual Studio, thus the problem can be in Visual Studio services, which CodeRush uses.
        Once we will have any progress, we will notify you about it in the context of the current ticket.

        Answers approved by DevExpress Support

        created 4 years ago

        We have addressed the issue described in this ticket and will include a fix in our next maintenance update. Should you need to apply our fix prior to official release, you can request a hotfix here.

        Note: Hotfixes may be unavailable for betas/updates set for release within a week.

          Comments (2)

            Thanks DevExpress team! I have installed the maintenance release and verified on my end that the issue is resolved. Thanks for the support!

            DevExpress Support Team 4 years ago

              You are welcome.
              Thank you for the notifying us about that problem is resolved on your side.

              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.