Ticket T609158
Visible to All Users

Smart Copy / Paste should automatically introduce a local variable like in CodeRush Classic

created 7 years ago

[DevExpress Support Team: CLONED FROM T609122: Object Initialization Formatting indentation rules not followed on subsequent format of document]

I could get used to splitting things out more, but I would certainly love to see the Smart Copy / Paste automatically introduce a local variable for me as in CodeRush Classic -- otherwise splitting things out interrupts my flow too much.

Comments (3)
DevExpress Support Team 7 years ago

    Jason,

    I am not sure that I understand what scenario with Smart Copy \ Paste you consider to be missing if compared to CodeRush Classic. So, please provide us with a code sample or a screencast that illustrates this in action.

    We appreciate your cooperation.

      I can't really do that because I don't have an old version of VS installed, nor CodeRush Classic.

      CodeRush Classic had a "Smart Cut/Paste" feature as a sub-option of Smart Copy/Paste where I could select an object initialized out of the middle of a code segment:

      C#
      DoSomething(new Request() { Foo = bar });

      and then I could cut "new Request() { Foo = bar }" and paste it above. It would introduce a new local variable automatically in front, automatically adding a reference to the new variable in the place I cut from and I'd end up with:

      C#
      Request request = new Request() { Foo = bar }; DoSomething(request);

      just by pasting that segment.

      It was a very slick feature that I'd like to see again.

      Incidentally, I just noticed that 'Introduce Local' feature got added somewhere along the way since I started using CR for Roslyn, so that will be sufficient for me if you don't want to re-implement Smart Cut / Paste.

      DevExpress Support Team 7 years ago

        Thank you for the clarification, Jason.

        You are talking about the Intelligent Paste feature.
        You are right, it is not ported from CodeRush Classic yet, but we have a card for this feature in our product backlog.
        I have added your request to this card, so we will take it into account when we plan future releases.

        We will notify you when we implement this in CodeRush for Roslyn.

        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.