Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resharper 6 - automatically adding "this"

There is a naming style in a company I work for that "this" must be added to every function, property call and field. Sometimes I forget about it. I want Resharper to do it automatically.

Any suggestions?

like image 863
Alexandre Avatar asked Jul 27 '12 06:07

Alexandre


People also ask

What is new ReSharper?

ReSharper 2021.2 offers new inspections with quick-fixes for C# code analysis and nullable reference types support, and many of the features available for manually-written code files are now available for source-generated files.

How do I run ReSharper cleanup?

Select ReSharper | Options from the main menu or press Alt+R O . Go to the cleanup profiles settings page: Code Editing | Code Cleanup | Profiles. Select which Code Cleanup profile should be applied on save and click Set as default (the default profile is also used for silent cleanup).

How good is ReSharper?

ReSharper is a renowned productivity tool that turns Microsoft Visual Studio into a much better IDE. Both individual . NET developers and teams rely on ReSharper to write and maintain code in a more manageable and enjoyable way, adopt the best coding practices, and deliver higher quality applications faster.

What is the use of ReSharper in Visual Studio?

ReSharper C++ is a developer productivity extension for Microsoft Visual Studio. Explore code, perform refactorings, find and fix errors and code issues, write quality code faster, and enjoy developing Unreal Engine games.


1 Answers

Find option ReSharper | Options -> Code Editing | C# | Formatting Style | Other -> Other | Force "this." qualifier for instance member and change it to Use always, then run full Code Cleanup.

like image 121
Dmitry Osinovskiy Avatar answered Sep 17 '22 12:09

Dmitry Osinovskiy