User Tools

Site Tools


notes:tools:resharper

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
notes:tools:resharper [2019/01/08]
leszek [Troubleshooting]
notes:tools:resharper [2019/01/18] (current)
leszek [Coding Assistance]
Line 1: Line 1:
 ====== ReSharper ====== ====== ReSharper ======
 +
 +====Search & Navigation====
 +
 +^  Command ​ ^  Keyboard Shortcut ​ ^  Remarks ​ ^  ​
 +| Navigate > Go to Declaration\\ (after selecting a symbol) | F12 | - Also navigates to partial classes and decompiled sources.\\ - For overridden symbols allows you to navigate to base symbols or derived symbols. |
 +| Navigate > Go to Everything / Type | Ctrl+T | - Also navigates to filenames.\\ - Allows you to include types from libraries.\\ - Supports camel humps search.\\ - Supports jumping to a specified line in source code.\\ - Double Ctrl+T allows you to search just the types (no filenames, no members, etc.). |
 +| Navigate > Go to Symbol | Shift+Alt+T | Navigates to a class as well as any class member. |
 +| Navigate > Go to File Member | Alt+\ | Navigates to members is the current file. |
 +| Navigate > Go to Text | Ctrl+T Ctrl+T Ctrl+T | Includes text in comments. |
 +| Navigate > Go to Action | Ctrl+Shift+A | - Searches ReSharper own functionality.\\ - Shows where the actions are in the menu.\\ - Shows keyboard shortcuts. |
 +
 +Navigate down and up the class hierarchy:
 +
 +^  Command ​ ^  Keyboard Shortcut ​ ^  Remarks ​ ^  ​
 +| Navigate > Derived Symbols\\ (after selecting an interface or a base class name) | Alt+End | Shows derived classes from the selected interface or the base class.\\ Also shows the classes that derive indirectly (transitive relationships). |
 +| Navigate > Base Symbols | Alt+Home | You can also navigate to the base symbol by clicking an icon on the left gutter. |
 +| Inspect > Hierarchies | Ctrl+E,H | - Visualizes inheritance hierarchy.\\ - Brings architecture explorer (diagram). |
 +
 +You can also go up and down on the hierarchy of members such as overridden properties and methods.
 +
 +Alt+` shows Navigate To menu. It shows any possible navigation option available for the selected symbol.
 +
 +{{resharper-navigate-to.png}}
 +
 +Numbered bookmarks, for example '​1':​
 +
 +  * Toggle a bookmark: Ctrl+Shift+1
 +  * Go to a bookmark: Ctrl+1
 +  * Delete a bookmark: Del in the Bookmark menu
 +
 +^  Command ​ ^  Keyboard Shortcut ​ ^  Remarks ​ ^  ​
 +| Navigate > Bookmarks > Bookmarks | Ctrl+` | Shows the list of bookmarks (numbered and anonymous). |
 +
 +Find all locations a selected symbol is used:
 +
 +  * Navigate > Usages of Symbol (Shift+Alt+F12) - shows usages
 +  * Find > Find Usages (Shift+F12) - shows a separate window with preview code
 +
 +Find locations where a class is returned from a method or a property:
 +
 +  * Navigate > Navigate To (Alt+`) > Exposing APIs
 +
 +Find extensions methods which are defined on a selected class:
 +
 +  * Navigate > Navigate To (Alt+`) > Extension Methods
 +
 +
 +====Coding Assistance====
 +
 +Code Analysis
 +
 +  * show available coding assistence options: put cursor over a symbol, Alt+Enter ​
 +  * Marker Bar 
 +
 +Usings and References
 +
 +  * Import a missing using statement: Alt+Enter. It also creates a reference if needed.
 +  * You can also use the ReSharper NuGet browser.
 +
 +Typing Experience
 +
 +  * Duplicate a line of code or a selection: Ctrl+D
 +  * Extend selection: Ctrl+Alt+RightArrow
 +  * Rearrange code (mode a line of code up and down): Ctrl+Shift+Alt+UpArrow,​ Ctrl+Shift+Alt+DownArrow
 +
 +Code Completion
 +
 +  * Complete Statement (adding a semicolor, missing parentheses,​ scope brackets, etc.): Ctrl+Shift+Enter
 +  * Camel humps in IntelliSense code completion.
 +  * Double basic code completion: 2 x Ctrl+Space
 +  * Smart Code Completion (shows only relevant members in IntelliSense,​ for example, the ones that return an int): Ctrl+Alt+Space
 +  * Multi-level smart code completion shows indirect members: Ctrl+Alt+Space multiple times.
 +  * Generative completion examples: ctorf (a ctor that initializes all fields), ctorp (a ctor that initializes all properties),​ overrides (type a method name e.g., ToString and then press Tab).
 +
 +Code Generation:
 +
 +  * Open Generate Code menu: Alt+Insert
 +
 +Postfix completion:
 +
 +[[https://​www.jetbrains.com/​help/​resharper/​Postfix_Templates.html|Postfix Templates]]
 +
 +{{resharper-postfix-completion.png}}
 +
 +{{resharper-postfix-completion-2.png}}
 +
 +
 +Encapsulating property generation:
 +
 +{{resharper-encapsulating-property.png}}
 +
 +The Alt+Enter menu on a selected piece of code:
 +
 +{{resharper-menu-on-selected.png}}
 +
 +While the menu is shown you can also start typing an action name and ReSharper will show all related commands.
  
 ====Options==== ====Options====
Line 34: Line 130:
  
   * Additional products: dotMemory, dotTrace, etc.   * Additional products: dotMemory, dotTrace, etc.
 +
 +Configure what happens when you Go To Declaration:​
 +
 +{{resharper-external-sources.png?​600}}
 +
 ====Troubleshooting==== ====Troubleshooting====
  
notes/tools/resharper.1547005174.txt.gz ยท Last modified: 2019/01/08 by leszek