Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 995
Lancelot Avatar asked Mar 17 '11 18:03

Lancelot


2 Answers

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.

like image 53
p.campbell Avatar answered Sep 26 '22 15:09

p.campbell


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

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

like image 35
0E322070 Avatar answered Sep 22 '22 15:09

0E322070