How to show (identify easily) `Disposable` variables within Visual Studio?

86 views Asked by At

[I have searched similar questions, but most of them seem at least 5 years old. The most near seemed this answer but it is not clear answer and is 5yrs old]

My question: What should we do if we want Visual Studio showed (I)Disposable variables and properties with different color (or somehow visually noticeable) in IDE? For example, I easily spoted all such cases in VisualStudio:

var x = new XYZ();  //XYZ has .dispose() method
// or
var x = otherType.ToXYZ();
// or
var x = anotherVariableFromOtherClass;  //so this `anotherVariable` has also dispose() 

I have tried Resharper (but couldn't achieve using the above referred answer). I am also ok with free/simple approaches outside of Resharper too.

0

There are 0 answers