How to hide reference counts in VS2013?

怎甘沉沦 提交于 2019-11-26 06:52:29

问题


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.


回答1:


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:

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




回答2:


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




回答3:


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.




回答4:


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

"editor.referenceInfos": false

User and Workspace Settings




回答5:


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...



来源:https://stackoverflow.com/questions/17847927/how-to-hide-reference-counts-in-vs2013

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!