Shortcut for extract local variable in Visual Studio or ReSharper (for C#)

南笙酒味 提交于 2019-12-02 00:07:16

问题


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.


回答1:


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!