Resharper help documentation,
ResharperHelp documentation
---------- John 2014/8/06
1. Resharper Introduction
Resharper is an encoding extension. In addition to the. net language version, it also has other versions. For example, Java, PHP, and Object C.
In the. net Framework, it supports VS2003, 2010, and. Supported languages include c #, Vb, HTML, ASP. NET, MVC (up to 3.0 supported), JavaScript, CSS, XML, and XAML.
Resharper can help programmers quickly generate code, analyze code, reconstruct code, format code, code template, and unit test. It can be said that skilled use of this software can greatly accelerate the coding efficiency, improve the encoding standardization, accuracy, and robustness.
The following describes common Resharper functions. For more information, see the Resharper help document. For more information, see the help documentation.
Ii. Instructions for use
Code analysis isResharperThe most common features. Contains error prompts, project resolution, and quick correction.
(1)Code highlighting
When an error occurs in the Code, or other issues that may cause exceptions, improvements, or optimizations.ResharperThe code is highlighted.
(Error)
For example, it is not declared:
Syntax error.
(Warning)
When there are unused objects in the Code, such as values, classes, namespaces, and so on. The prompt is "gray. The gray part can be removed.
Click the Gray code line, and a red light bulb will appear on the right side:
ClickRemovexxxTo remove code lines. The following options are used for setting and are not recommended to be modified. Otherwise, it will be troublesome to change them back.
(Recommended)
Suggestion:ResharperAnother feature is very distinctive. We recommend that you write beautiful code and optimize the code structure. At the same time, we can develop good coding habits.
(2)Project resolution
Project resolution can analyze possible errors and warnings in the entire project. To enable project analysis, you can find the Enable button in the lower right corner.
Double-click and selectOK. If the project is large, for exampleClopAnd your computer2GMemory. Congratulations! You can have a 5-second break. This function is quite consumableCPUMemory consumption. Do not play with children's shoes that are physically poor. SuggestionsI5Processor or above,4GMemory or above,64Bit system for children's shoes. However, the card has passed, and there is a cache mechanism.
Disable code analysis from settings.
Project resolution completed,ResharperRelated warnings and error messages are displayed.
Double-click to quickly locate the code line, or press(ALT + F12)The next error is tracked.Shift + ALT + F12The previous error.
(3)Quick correction
When an exception or warning occurs in the Code, the programmer may not know how to correct it. You can use the quick correction function to correct the exception.Shortcut KeyAlt + Enter
There are two types of corrections. One is red., The first type is.
The red correction prompt is generally serious, or it is strongly recommended that the problem be corrected. Mark with a blue curve.
For example:
Yellow is a common and optimized problem. You can select or not to modify the settings. Use a green curve.
(1)Smart Object
Generally, our code prompts can only complete the context, or the objects in the project. For some code that you want to use, but cannot remember the name, or the word is long, you cannot accurately spell it out. You can use a short name+Shortcut Key (Ctrl + ALT + Space).
For example:
(2)Quick completion
Quick completion uses key combinations to quickly generate code snippets..The shortcut key isCtrl + shift + Enter
For example, we create a method:
PressCtrl + shift + EnterGenerate immediately
(3)Context resolution
Context resolution is the process of Automatically Analyzing the Code Compiled by the programmerResharperIdentified and can be adjusted. The programmer clicks the code line andIDEOn the right side of the page, you can see related icons.
There are three types of resolution:
: Code editing action
This action can optimize or adjust the object.
:Reconfigurable object
For example:
I have never seen it.
(4)Highlight Separator
In the coding process, it is sometimes difficult for us to figure out (and which. Especially in (rare cases. That's big. In some complicated logic methods, it is difficult to find the corresponding{}. By highlighting the delimiters, we can quickly find matching delimiters.
(5)Others
A)Fast comments to cancel comments.
Shortcut KeyCtrl +/, CanceledCtrl +/
You can select multiple lines to annotate multiple lines of code.Ctrl +/
You can also pressCtrl + shift +/
B)Copy history
Although part of our work is repetitiveCtrl + C,Ctrl + V. But it still needs a little bit.MeansAnd tips.
Shortcut KeyCtrl + Shift + VWhat do you see? Copy history. Everything you copied is in it.
Writing againGetSet? Are you still trying to write constructor? Are you still implementing interface objects one by one? WithResharperYou can have lessNLine of code.
Shortcut KeyAlt + Insert;Ctrl + Alt + Insert
For example:
Generate attributes, private object, private constant, please pressP
Generate class and constructor. PressC
GenerateIf,Else,For,Foreach
Please pressF, PressEnterOrTABKey.
There are also some, such as while, try, or something. Just press the first letter.
Complete code template is required. PLEASE PRESSCtrl + J.
InsertRegion, PressCtrl + Alt + J
Code cleanup shortcutCtrl + Alt + F
There are two types of code cleanup: complete cleanup and formatting.
For specific object cleanup, see
The complete cleanup will include redundant objects and redundant objects.This, Use automatic attributes, useVar, ArrangeUsingAnd format the code line.
Formatting code is equivalent to reorganizing the code and removing redundant spaces, making the code more neat and beautiful.
In the face of a big push of code, we need to quickly find all the relevant code that uses a certain object. Or view its declaration to view the code structure. In this case, you need to use the code navigation function.
()Positioning declaration, definition:
Ctrl +Left mouse button orCtrl + B
Press and holdCtrlOn the object to be located, right-click the object to find its declaration and definition.
(B)View code structure
Shortcut KeyCtrl + F11
(C)View code levels
When an object is the parent class or subclass of another objectShortcut KeyCtrl + Alt + HTo view the code hierarchy.
(D)Locate declared base class or overloaded object
Shortcut KeyCtrl + U
(E)Locate the object implementation
Shortcut KeyCtrl + Shift + Alt + B
This shortcut key is too long. Generally, right-click the menu and selectGoImplementation.
(F)Query object usage
Sometimes we need to check an object or where the method is called. You can use the shortcut keyAlt + F7, OrShift + Alt + F7.
(G)Bookmarks
You can useShortcut KeyCtrl + ~.
Select the code line and pressCtrl + ~, Move the cursor to the tag to be inserted. PressInsertInsert a tag. If the tag is removed, select the tag and pressDeleteOr click the tag on the left to delete the tag.
Code refactoring has always been a headache. Rename is okay. When a method parameter changes, I want to extract the interface, abstract the method, or change the abstract class into an interface. Change the attribute to a method, and change the method to an attribute.
PassResharperOfRefactorFunctions can be securely implemented.
There are many refactoring types. If you are interested, you can viewRefactorThis section describes in detail.
Localization is used to reference local resources, including files and objects, in Web development. For more information, see the help documentation. The main function is to quickly reference or load local objects.
The unit test function is used to test the method. On the left side of the unit test method, you can see the button.
Click the corresponding button to test the corresponding method.
3. Common shortcut keys
Some common shortcut keys are sorted out for your reference. You can print it out and paste it on the table to facilitate your memory.
Edit
Ctrl + Space Code complete
Ctrl + Shift + Space Code complete
Ctrl + Alt + Space Code complete
Ctrl + P display parameter information
Alt + Insert generate constructor, attribute, reload member function, implement Interface
Ctrl + Alt + J generate if, try .. catch, # region Block
Ctrl +/comment and cancel // comment
Ctrl + Shift +/comment and cancel/**/comment
Ctrl + W incremental select Block
Ctrl + Shift + W incremental invert Selection
How to fix the error displayed by Alt + Enter
Ctrl + Alt + F format code
Ctrl + Alt + O modify and optimize as instructed
Ctrl + D copy the current row or selected block
Search
Alt + F7 search for variables and reference methods
Alt + Shift + F7 search in the Set Range
Ctrl + Shift + F7 highlighted
Ctrl + Alt + Up/Down locate to bottom/previous reference
Ctrl + Alt + F7 quick reference location locating
Ctrl + Shift + F4 close search result tab
Ctrl + Alt + U locate the search result
Navigation
Ctrl + N locate to type
Ctrl + Shift + N locate by file name
Ctrl + E recent file list
Ctrl + Shift + Backspace last edited location
Ctrl + B Jump to the variable Declaration
Ctrl + Alt + B Jump to the inheritance class or interface
Ctrl + U adjusted to base class
Ctrl + Shift + T jump to type declaration
Alt + Up/Down to the next/previous method
Ctrl + F12
F2/Shift + F2 lower/previous High Brightness Display Error
Ctrl + Shift + E Stack Trace
Refactoring
F6 move the class to another namespace
Shift + F6 method rename
Ctrl + F6 change Signature
Ctrl + Alt + N
Ctrl + Alt + M extract the selected block as a method
Ctrl + Alt + V Change the variable name and type
Template
Tab generates template based on abbreviations
Ctrl + J insert Template
Built-in Template:
Asrt generates assertion
Ear generates an empty array
Foreach generate foreach Blocks
Iterator for generating ArrayList
Iteration loop of array generated by itar
Itdic generation of dictionary iteration cycle
Loop generation loop
Out print string
Outv print variable value
Pci public const int
Pcs public const string
Pro protected
Psr public static readonly
Psvm main () method declaration
Ritar Iterate an array in reverse order
Sfc Safely cast variable
Thr throw new
Toar converts ArrayList to array
Iv. Tool options
You can configure the Resharper option as needed.
If you want to use the Resharper shortcut key, you need to change the key bit to Resharper.
To highlight the current line, check Hightlight cuttent line.
If you do not like the smart prompt menu of Resharper, you can restore it to vs, but I suggest you stick to it. The smart prompt menu of Resharper is better than that of.
The version is XX, so we do not recommend that you upgrade it.
We do not recommend that you modify other code and language settings. By default, this person has been well configured. It's hard to change it back.