4 Replies Last post: Nov 7, 2013 7:46 PM by CoffeeAddict  
CoffeeAddict Novice 122 posts since
Oct 6, 2009
Currently Being Moderated

Nov 4, 2013 9:42 AM

Keyboard Shortcut for "Generate Class"

Is there a keyboard shortcut for this?  I can't find it in your shortcuts list on your doc site:



Matt Ellis Apprentice 573 posts since
Jul 5, 2009
Currently Being Moderated
Nov 7, 2013 2:24 PM in response to: CoffeeAddict
Re: Keyboard Shortcut for "Generate Class"

The "Generate" menu that you're showing in your screen shot is a Visual Studio feature, not a ReSharper one.


The ReSharper Way is (of course!) alt+enter on the undefined class name, and create a class from there. ReSharper has no context on where the class should be (is it a production class? Test class?) so it creates it in the same file. Alt+enter on the class name allows you to move it to a new file, or you can use the Move refactor (F6 for IntelliJ scheme, ctrl+R, O for VS) to move the class to a new file, folder, namespace or project.


Alternatively, you can use alt+insert when the solution explorer has the focus and create a Class, Struct, Enum, Interface, etc (and this list can be edited and modified from the Templates Explorer). You can also use ctrl+alt+insert to create a file from a template next to the current file, but that will also most likely need to be moved into your production code.


And finally, you can of course use the "class" Live Template to create a class in the current file, although you'll need to type in the name yourself.


Hope this helps!


More Like This

  • Retrieving data ...