Lancelot
Lancelot

Reputation: 2427

Visual Studio equivalent to Eclipse keyboard shortcut Alt Shift L

I just did a few years of Java and I'm now back in the C# world. I'm actually happy to be back in Visual Studio except for one thing.

The Eclipse shortcut: ALTSHIFTL really grew on me and I can't find an equivalent in Visual Studio to extract local when the cursor is on a method.

Anyone knows the equivalent in Visual Studio please?

Upvotes: 6

Views: 4195

Answers (4)

Jani86
Jani86

Reputation: 1

With extension VAssisX, you can bind keys to this: VAssisX.RefactorIntroduceVariable

And I think this does what you want.

Upvotes: -1

Mr_and_Mrs_D
Mr_and_Mrs_D

Reputation: 34076

For MSVS 2013 you can download Productivity Power Tools 2013 to get Extract Constant - features also Ctrl + Click to Peek Definition (customizable to Go to definition as in all other IDEs I used) and it is free !

To install go to Tools > Extensions and Updates... then Online

Upvotes: 1

0E322070
0E322070

Reputation: 762

TO get 'Extract Constant' you need to install 'PowerCommands for Visual Studio 2010' from:

http://visualstudiogallery.msdn.microsoft.com/e5f41ad9-4edc-4912-bca3-91147db95b99/

Upvotes: 1

p.campbell
p.campbell

Reputation: 100647

There's no native Visual Studio 2010 refactoring command for 'extract local', as Eclipse has.

The closest you'd get is the 'Extract Constant', which isn't by default bound to a keyboard shortcut. To do this, you have to highlight the entire string, including the double-quote " delimiters.

extract constant

You could explore third party IDE addons like CodeRush or ReSharper for more functionality.

Upvotes: 4

Related Questions