13
votes

Visual Studio 2013 introduced a new feature, Code Lens, where it shows you how many times each of your methods are called/referenced, how many unit tests cover the method, and how many are passing. The code lens information appears above the method and below any attributes the method has like so:

code lens looks like it is associated with the wrong data member

If the method has a lot of attributes they can appear separate from the method. As proximity in design implies relationship, the attributes can appear to be associated with something else. This is especially the case if you are accustomed to not having line breaks separating methods. Is there anyway to move the code lens feature so it appears above the method attributes?

1
We did this because there is the possibility of having a LOT of attributes on a method, which might push the indicator away from the method declaration. This way it was always in the same place for things with attributes and things without attributes.John Gardner
@JohnGardner and that makes sense. The only place I have found that it is an issue is when you don't have a newline after your method. In that scenario the attributes appear to be associated with the previous method.Aran Mulholland

1 Answers

9
votes

This is currently not supported. But has been requested from Microsoft. See the connect report below.

http://connect.microsoft.com/VisualStudio/feedback/details/810015/display-codelens-above-attributes-if-any-present