Resharper 6 - automatically adding "this"
Asked Answered
I

1

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?

Influential answered 27/7, 2012 at 6:44 Comment(0)
H
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.

Hance answered 27/7, 2012 at 15:21 Comment(3)
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 -> NoneCoquetry
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 -> NoneLazybones
Further into the future (2020.1): ReSharper | Options -> Code Editing | C# | Syntax Style -> Use "this." qualifier for -> NoneSteamy

© 2022 - 2024 — McMap. All rights reserved.