Ticket T424467
Visible to All Users

"Widen scope (promote to field)" not available?

created 8 years ago

CodeRush Classic used to have two "Widen scope" refactorings: one that worked locally within the given method and another that moved a local inside a method out to a field inside the class.
The former is part of CRR, but I cannot seem to get the later to work.

Is this refactoring not yet available with CRR (knowing that CRR is still relatively young compared to Classic), or is it perhaps broken in the current build?

Removing the local declaration and using "Declare Field" works, but that leaves the assignment where it is…actually, so does Classic "Widen scope (promote to field)", which I was fairly sure that it would also move the assignment with it (if there were no other local dependencies).

Answers approved by DevExpress Support

created 8 years ago (modified 8 years ago)

Hi Emanuel,
We have published version 16.2.3. It contains the "Widen Scope (promote to field)" action (see the screencast). You can download it from the Visual Studio marketplace:
https://marketplace.visualstudio.com/items?itemName=DevExpress.CodeRushforRoslyn

    Comments (1)
    EW EW
    Emanuel Wlaschitz 8 years ago

      Thanks!

      created 8 years ago (modified 8 years ago)

      Hi Emanuel,
      Thank you for contacting our support team.
      Though the Widen Scope (promote to field) refactoring has not been ported to CodeRush for Roslyn yet, we are planning to introduce this functionality in one of our future releases.

        Comments (2)
        EW EW
        Emanuel Wlaschitz 8 years ago

          Alright, thanks for letting me know!

          DevExpress Support Team 8 years ago

            You are welcome.

            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.