ReSharper has been focused on supporting backend languages such as C# or VB.NET from the beginning. Fortunately, with almost every release, there are more and more languages that are supported.
Currently, ReSharper provides you with many features that can be used by almost every .NET developer. Most of these features are dedicated to web developers.
In this chapter, we will explain how ReSharper supports the following:
As we have described most of these features, here we will only quickly describe how they support web development without a detailed description.
In terms of web development in Visual Studio, ASP.NET was the first area that was supported by ReSharper. Currently, almost every ReSharper feature supports ASP.NET in some way—both Web Forms and MVC.
In the same way as in C#, ReSharper helps you write ASP.NET by extending IntelliSense, generating code, and providing you with some refactoring methods.
IntelliSense provides you with prompts for web-related things, such as ASP.NET controls, ASP.NET MVC helpers, resources, JavaScript symbols, and so on.
While working with ASP.NET, ReSharper helps you in importing required namespaces and removing unused directives (same as with using
statements in C#).
As with C#, ReSharper allows you to generate members based on the implemented interface; in ASP.NET, you can generate Content tags based on ContentPlaceHolders from your Master Page and the required event handlers.
When you are working with the ASP.NET project, ReSharper allows you to use file templates that are specific to ASP.NET. You can find templates to add web pages, controls, and Razor views, as shown in the following screenshot:
And of course, you can define your own templates.
In case of navigation, you can find well-known features such as displaying the File Structure or navigation through file using the Go to File Member option by pressing Alt + . Using the Go to File Member option, you can search by HTML tags, IDs, CSS classes, and any other object used in your view. A sample search by HTML tag and element ID is shown in the following screenshot:
A very useful feature in web applications is Go to Related Files. You can access this option by pressing Ctrl + Alt + F7. It is also available in C# but is most useful in ASP.NET or HTML code. It allows you to quickly navigate to related files, such as JavaScript, CSS, Master Page, Controls, and any related code.
The following screenshot presents you with a list of related files for a sample ASP.NET MVC view:
As you can see, it contains the controller that is related to this view, the JavaScript files declared in this file, the master layout, and CSS files declared in this layout.
In case of support for ASP.NET MVC, the most important feature is IntelliSense, which prompts you the controllers and controller's methods every time you need to specify them. A sample usage is shown in the following screenshot:
ReSharper also improves navigation between controllers and views, and detects non-existent views, as you can see in the following screenshot:
The preceding screenshot presents the return
statement from the Process
method.
3.12.123.189