728
votes

Visual Studio 2013 introduced a new feature where it shows you how many times each of your methods are used.

I don't find it very useful, and it messes up the spacing of my file. How do I disable it? Can't seem to find the option.

5
@Ouadie: You're allowed to like it. XIII (rightfully) already edited out the bias from my question :-) The only numbers I care about are "0" and "1+". IntelliJ will underline your method to tell you it's unused (if it's private, anyway). I'd much prefer that over the odd spacing this creates, particularly when there are attributes above.mpen
I find the feature quite nice. But I get quite sensitive about white-space in my code which makes it extremely distracting. Ideally it would be possible to replace it with a little dot like a breakpoint in the margin...AndyM
I specifically came here to find out the exact opposite of this... but this works too.misterManager
Editing someone else's question to "remove bias" is hypocritical and censorship. Don't do it.Glenn Maynard
This is in VS 2015 Professional. Shame it isn't in the left-hand column though, it's a bit distracting. Like Mark said only 0 and +1 (or even just 0) is relevant.Rob L

5 Answers

812
votes

I guess you probably are running the preview of VS2013 Ultimate, because it is not present in my professional preview. But looking online I found that the feature is called Code Information Indicators or CodeLens, and can be located under

Tools → Options → Text Editor → All Languages → CodeLens

(for RC/final version)

or

Tools → Options → Text Editor → All Languages → Code Information Indicators

(for preview version)

That was according to this link. It seems to be pretty well hidden.

In Visual Studio 2013 RTM, you can also get to the CodeLens options by right clicking the indicators themselves in the editor:

editor options

documented in the Q&A section of the msdn CodeLens documentation

98
votes

Another option is to use mouse, right click on "x reference". Context menu "CodeLens Options" will appear, saving all the navigation headache.

20
votes

Workaround....

In VS 2015 Professional (and probably other versions). Go to Tools / Options / Environment / Fonts and Colours. In the "Show Settings For" drop-down, select "CodeLens" Choose the smallest font you can find e.g. Calibri 6. Change the foreground colour to your editor foreground colour (say "White") Click OK.

17
votes

The other features of CodeLens like: Show Bugs, Show Test Status, etc (other than Show Reference) might be useful.

However, if the only way to disable Show References is to disable CodeLens altogether.

Then, I guess I could do just that.

Furthermore, I would do like I always have, 'right-click on a member and choose Find all References or Ctrl+K, R'

If I wanted to know what references the member -- I too like not having any extra information crammed into my code, like extra white-space.

In short, uncheck Codelens...

15
votes

In VSCode for Mac (0.10.6) I opened "Preferences -> User Settings" and placed the following code in the settings.json file

enter image description here

"editor.referenceInfos": false

enter image description here

User and Workspace Settings