In my code I have a lot of this.
qualifiers (a habit from writing Python code), so I have a lot little orange warning markers in the right hand gutter saying "Qualifier 'this.' is redundant". I don't want to remove the this.
qualifiers. How can I turn off the orange warning markers?
For Resharper 9 it's been moved. Actually I never noticed in Resharper 8, because I use "this" for clarity. My problem is that now it's all over the place and it drives me insane. I hope this helps someone, because it took me some time to find this.
Change your settings in the Inspection Severity section. In the C# tab, there is a section called Redundancies in Code
. In there is a Redundant this.' qualifier
setting. I put mine on
"Do not show" (gray-colored).
The following is taken from the comment by @user2864740, which the OP found to solve the problem:
It should be possible to open up the ReSharper context menu - click on the pencil thing to the left when the warning is "in focus", or perhaps hit Alt+Enter (?) - and select "Change Inspection Severity..". It should provide several options from Ignore to Error. I believe there is also an inspection option to Require the this. explicitly, but I've never felt inclined to look for or enable it. (Such an option would likely be within the main Code Inspection R# options.)
If you don't have the ($$$) Resharper, you don't need it to remove the orange warning markers or the lightbulb suggestions. You can do this within VS 2015: Follow exactly this set of instructions in the green-checked answer, but tick the "Qualify member access with 'this' " instead. Click OK, and you'll never see another this
lightbulb again.
I don't know if this particular configuration is available in other VS versions, but at least you can check your version.
OR, apply the change globally (project-wide or solution-wide) with one click as demonstrated here:
And you'll never see it again in your project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With