Resharper live templates tutorial




















Code analysis hints make missing function returns, missing breaks in switch statements, and disposed resources easier to notice. A fix popup that appears for non-imported types. For more information, see Import missing namespaces. A marker corresponding to a warning is displayed on the marker bar. Action indicator that appears to the left of the caret position if ReSharper has anything to suggest there.

High-priority code issues in this case, errors related to an unresolved symbol and an incorrect return type are highlighted with red text and a red curly underline. If solution-wide analysis is enabled, ReSharper allows you to see even more code issues. In this example, it detects the unused public member and notifies you of errors in other files in your solution. Click the solution-wide analysis icon to explore the detected issues.

A short description of the issue at the caret appears in the status bar. You can also use the Quick Launch box to find and execute ReSharper commands:. ReSharper provides a lot of navigation and search features. Let's look at some of the most useful ones. Press the Ctrl key and hover the mouse over your code. You will see that all symbols defined elsewhere become underlined when in focus. You can click any symbol while holding down the Ctrl key to navigate directly to its declaration.

If the symbol is defined in the current solution, ReSharper opens the corresponding file and brings the caret to the declaration. If the symbol is defined in a compiled library, ReSharper opens it according to your preferences. For more information, see Go to Declaration. ReSharper will quickly find and display all usages of the symbol. For more information, see Find Usages. When you press it on any symbol, ReSharper will show you all available navigation options: For more information, see Navigate To.

The list of suggestions appears as soon as you invoke this feature and initially includes your recent files and navigated items. You can start typing to find types, symbols, files, recent edits, recent files, and recently viewed methods. When a navigation command brings you to a new file, you may want to see where it is in the Solution Explorer. When you are working in the editor, many code editing helpers are at hand. Here are a couple of them. ReSharper complements and extends Visual Studio's native code completion IntelliSense with more advanced capabilities.

To learn more, see Storage of templates. Click New Template. The newly created template is opened in the Template editor. Specify template shortcut in the Shortcut field. It is used to quickly invoke the template when creating code from template ; it also appears in completion lists. In the Description field, type optional description for the template. To change the default scope of the template , click the Availability hyperlink. In the dialog that appears, use check boxes to define where the new template can be applied.

As you select or deselect parameters, the Template text view changes accordingly. If you are unsure whether to use the suggested template parameters or not, study the Template parameters section.

Also, you will be able to introduce other parameters into the created template in the next steps.



0コメント

  • 1000 / 1000