Reporter | Joe White (joewhite) |
---|---|
Created | Oct 23, 2009 7:21:46 PM |
Updated | Apr 10, 2018 8:47:26 PM |
Subsystem | Code Analysis |
Assignee | Ivan Serduk (IvanSerduk) |
Priority | Normal |
State | Submitted |
Type | Feature |
Fix version | 2018.2 |
Affected versions | No Affected versions |
Fixed In Version ReSharper | Undefined |
VsVersion | All Versions |
"Highlight Usages in File" (in the ReSharper > Search menu) highlights "read" usages in blue, and "write" usages in pink. This is useful for value-type fields. But I do a lot of Highlight Usages on collection-type fields, and usually what I'm looking for is usages that are modifying the collection contents. The current color-coding doesn't help me with that – if the code calls the Add method, it's only reading the collection variable, so the color-coding is the same as read usages, even though in my mind, it's more akin to a write usage.
So, it would be great if this could be enhanced to have another color for collection mutator usages. For example, if I'm highlighting usages of a field (or property) called MyList:
My specific pain point is collections, so I'm limiting this feature request to the mutator methods on List<T> and IList<T>. Obviously, there's temptation to make a general system for tagging any method as a mutator method, but that would require a lot more design and implementation work. But even a simple, limited-to-collections implementation would still address a need, and have a lot of value (and could probably make it into a much earlier release than a general system).
So, it would be great if this could be enhanced to have another color for collection mutator usages. For example, if I'm highlighting usages of a field (or property) called MyList:
MyList = new List<Foo>(); // MyList highlights as a "write" usage
var x = MyList.Count; // MyList highlights as a "read" usage
MyList.Add(new Foo()); // New: MyList would highlight as a "modify" usage
My specific pain point is collections, so I'm limiting this feature request to the mutator methods on List<T> and IList<T>. Obviously, there's temptation to make a general system for tagging any method as a mutator method, but that would require a lot more design and implementation work. But even a simple, limited-to-collections implementation would still address a need, and have a lot of value (and could probably make it into a much earlier release than a general system).