Is there a shortcut for extracting local variable in VS or ReSharper? I know that there are shortcut for extracting field variable but I cannot find for extracting local variable. Thanks in advance.
Right-clicking a local variable, I get this context menu:
Assuming you want shortcuts for the highlighted commands, you can define your own shortcuts through the Visual Studio keyboard mapper. (Tools -> Options -> Environment -> Keyboard)
- Introduce Variable... = "ReSharper.ReSharper_IntroVariable"
- Introduce Field... = "ReSharper.ReSharper_IntroduceField"
- Introduce Parameter... = "ReSharper.ReSharper_IntroParameter"
FYI My keyboard shortcuts were set by ReSharper via ReSharper -> Options -> Keyboard & Menus and applying the "Visual Studio" scheme.
(Using Visual Studio Community 2015 and ReSharper Ultimate 2015.2)
来源:https://stackoverflow.com/questions/33850527/shortcut-for-extract-local-variable-in-visual-studio-or-resharper-for-c