How to turn off CodeLens-References

Visual StudioVisual Studio-2013Codelens

Visual Studio Problem Overview


I recently installed Visual Studio 2013 Ultimate. Now, as you know, there is this "n references" above all methods.

When I go to the CodeLens options, I can't disable this single feature, since the checkbox is grayed out.

Options for enabling specific Code Lenses

So how can I disable it?

Visual Studio Solutions


Solution 1 - Visual Studio

Only workaround I found was un-checking the "enable codelens" option.

Solution 2 - Visual Studio

The References indicator is required to be on because it is the only one that knows how to do "placeholder" items (the one that says "- references"), and is guaranteed to show up everywhere that codelens appears.

If you could turn off references, then it is highly possible that codelens would reserve space for indicators, and yet no indicators would ever appear, so you would end up with blank lines on every method/class/property that aren't real blank lines, they're just reserved space for codesense elements that will never appear.

I'd suggest using the "send a frown" thing in visual studio and commenting about this if you want to turn just references off.

Solution 3 - Visual Studio

If you want to keep the CodeLens functionality but mostly get rid of the references, go to:

  • Options/Environment/Fonts and Colors
  • Show settings for: CodeLens

and change the settings to:

  • Font: Consolas
  • Font Size: 6
  • Indicator Text: White
  • Indicator Text (Disabled): White
  • Indicator Separator: White

Choosing Consolas reduces the line height beyond the default Calibri font, even at font size 6. There might even be a smaller font that you can use but I haven't found it.

If you have a dark background choose a matching dark color instead of White where it is mentioned in the steps above, since the goal is to hide the CodeLense text.

Solution 4 - Visual Studio

In Visual Studio 2015. Tools > Options. Text Editor > All Languages > CodeLens. Uncheck “Enable CodeLens”

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionIMXView Question on Stackoverflow
Solution 1 - Visual StudioMahenderView Answer on Stackoverflow
Solution 2 - Visual StudioJohn GardnerView Answer on Stackoverflow
Solution 3 - Visual StudioWayne BlossView Answer on Stackoverflow
Solution 4 - Visual StudioTaiyebView Answer on Stackoverflow