17

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?

Alexandre
  • 13,030
  • 35
  • 114
  • 173

1 Answers1

26

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.

Dmitry Osinovskiy
  • 9,999
  • 1
  • 47
  • 38
  • 15
    For anyone in the future: In ReSharper 9, I had to change the setting in `ReSharper | Options -> Code Editing | C# | Code Style -> Use "this." qualifier for -> None` – Eric Hotinger Jun 25 '15 at 15:00
  • 3
    For anyone in the future future: In ReSharper 2017.2, in addition to @EricHotinger comment i had to changed one more setting in `ReSharper | Options -> Code Editing | C# | Code Style -> Qualify members declared in -> None` – Yury Kerbitskov Oct 25 '17 at 08:53
  • 1
    Further into the future (2020.1): ReSharper | Options -> Code Editing | C# | Syntax Style -> Use "this." qualifier for -> None – DannyThunder Oct 06 '20 at 12:07