How to turn off CodeLens-References - visual-studio

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.
So how can I disable it?

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

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.

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.

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

Related

Is it possible to hide outline margin in Visual Studio 2012?

In Visual Studio 2012 it's a lot of margins to the left of source code text: Indicator Margin, Selection Margin and Outline Margin. As an old programmer i prefer an uncluttered text, so i want all 3 margins to be hidden from me. In Text editor settings i can hide indicator and selection margins, but i didn't found how to hide an outline margins. Outline graphics (all this "+" things and ines) can be easily hidden from "edit" menu, but margins itself remains. Is it possible to hide it or such feature is not implemented? In previous versions of Visual Studio it auto-hides if "selection margin" was disabled, but now it seems that it don't hide at all :(.
Update
A little clarification why I need it. As correctly mentioned in comments, it's very unusual to have preferences for text formatting and appearance. I agree with that. Unfortunately, in my personal case, I work with text like 10 hours per day for dozens of years and my brain is kind of trained to calculate indentation from text editor left edge. And every time I work in Visual Studio my "wrong indentation" instinct is often triggered by this empty space :). Of course i can re-train myself, but since ALL editors except Visual Studio displays text close to left edge, I will try to configure Visual Studio first.
Turn off the Indicator margin with Tools + Options, Text Editor, General, untick "Indicator margin"
Turn off the Selection margin with Tools + Options, Text Editor, General, untick "Selection margin"
Turn off the Outline bar with Edit + Outlining, Stop Outlining. That is however liable to come back when you open a new file. You can make it consistent for the C# IDE with Tools + Options, Text Editor, C#, Advanced, untick "Enter outlining mode when files open". If you want to do this for other kinds of files as well then you need to write an add-in that listens for the DocumentEventsClass.DocumentOpened event.
I've created an extension for this, it's for VS2015 but if you haven't upgraded yet it should work for VS2012 as well (assuming you're using an edition that supports extensions). The source code is only a few lines and is shown in the screenshot of the posted link.
http://blogs.msdn.com/b/saraford/archive/2007/09/13/did-you-know-you-can-hide-outlining-selection-margin-without-turning-off-outlining.aspx
Tools – Options – Text Editor – General, and uncheck Selection Margin...
This work?
Go to VisualStudio->Tools->Options
Drill down to Text Editor->C#->Advanced and uncheck "Enter outlining mode when files open"
Other language editors have similar options to disable outlining mode.
Any files you have open before changing this setting need to be re-opened, or you can turn off outlining from the context menu for each open file. Easier to just close/re-open.
Hope that helps!
Here's an extension that worked perfectly for me: https://marketplace.visualstudio.com/items?itemName=JustinClareburtMSFT.HotSettings
It has custom options to hide/show:
the entire margin
breakpoint margin
line numbers
selection margin
I can't tell if anyone actually answered your question (which is mine today!). Please see http://www.codeproject.com/Articles/109611/Color-Indicator-for-Code-Changes-Track-Changes-in and particularly the "Enable / Disable" section: "Go to Tools > Options > TextEditor. In General section, you can check or uncheck the 'Track Change' option."
Agree this feature is a big visual hassle during initial development, but it can be helpful during "maintenance" changes.
Corrected per "external link" comment.

How to disable font smoothing in Visual Studio editor?

How can I disable the font smoothing in the text editor of Visual Studio? On some machines I use, this works, but, not in most of them.
The text in the editor on the left is not really sharp. But the font in Windows is.
There is an extension called Text Sharp that allows you to completely disable font smoothing (ClearType) for Visual Studio:
https://visualstudiogallery.msdn.microsoft.com/7aafa2ea-8c54-4da8-922e-d26bf018514d
I'm using this combined with the Source Code Pro font for very readable code.
Well, the characters are at least readable. The code itself may be a different story. :)
In Visual Studio 2019 v16.5.4 (possibly lower), there is a new feature under the Text Editor -> Advanced settings called "Text rendering method". This appears to be defaulted to "ClearType" upon installation. On my machine, I've disabled ClearType at the OS level, yet after a fresh install/update, noticed that my fonts were being smoothed.
Simply switch this setting to "Aliased" to get pixel-perfect font rendering back.
Again, this assumes you have already disabled ClearType at the system level. I am unsure if VS settings would ignore/override the system-level ClearType settings or not.
In my case the problem was that I had the text size to 120%, I just change it to 100%.
Is an option located in Display Settings above the Resolution selector. It says:
"Change the size of the text, apps, and other items"
set the value to:
100% (Recommended)
This happened to me when I added a new LCD monitor to my setup.
According to blogs.msdn.com and this post on SuperUser, you may have to disable it in many places, but for VStudio two are enough:
Control Panel > Display > Adjust ClearType Text
Control Panel > System > Adjust the appearance and performance of Windows > Visual Effects > Smooth edges of screen fonts
Don't use Consolas as it always uses ClearType, as Alex K. noted in the comments.
Prefer Lucida Console which is a fixed font (they are bold in VStudio's font list in Tools > Options > Environment > Fonts and Colors) and appears not to suffer from the effects of ClearType or smoothed edges.
For those willing to disable anti-aliasing/smooth edges/cleartype on VS Code as of today, there's no official option inside the VS Code program to do it. Instead, I have found this method that works for me, and it's thanks to this article: https://medium.com/kasun-kodagoda/fix-text-becomes-blurry-when-vs-code-application-loses-focus-issue-on-windows-d95697b2f927
Here are the steps:
<img src="https://i.stack.imgur.com/L2i9S.png" alt="..." />
Disable anti-aliasing VSCode Image:
Right click on VS Code program and go to Proprieties.
In the "target" section of the app, add the following lines: --disable-gpu --enable-use-zoom-for-dsf
Apply the changes and that's it.
I hope it's useful.
For me it helped to switch to "Consolas" font and then back to "Courier New" in Tools->Options->Environment->Fonts and Colors. Don't forget to press "OK" after switching to Consolas.

Disabling highlighting of current line in the Visual Studio editor

The Visual Studio editor highlights the current line by changing the background color of the current line. Is there a simple way to disable this highlighting? Otherwise, which parameter in Fonts and Colors dialog controls the background color of the currently selected line in the editor?
Is there a simple way to disable this highlighting?
Tools -> Options -> Text Editor, in the Display group, uncheck "Highlight current line"
Which parameter in Fonts and Colors dialog controls the background color of the currently selected line in the editor?
The colors are named "Highlight Current Line (Active)" and "Highlight Current Line (Inactive)"
To disable the border around the current line
In VS 2019
Go to : Environment -> Fonts and Colors:
Find the display item: Highlight Current Line
Set the item foreground color to: Automatic
In VS 2017 and earlier
Go to : Tools -> Options -> Text Editor:
Find the display items:
Highlight Current Line (Active)
Highlight Current Line (Inactive)
Set the item foreground color to: Automatic
if its visual code make
"editor.renderLineHighlight": "none"
The Visual Studio editor highlights the current line by changing the background color of the current line.
The only time I've seen this is when "Use Windows High Contrast settings" is enabled (Options > Environment > General)
With this setting disabled, I just get a subtle grey box to indicate the current line (this may depend on your Color Theme):
If you're using Resharper, it's:
Tools -> Options -> Text Editor:
ReSharper Current Line Highlight
press -> Ctrl + comma
Search => Render Line Highlight
select none from the options
In addition to the previous answer, I'd like to mention that Visual Assist (the tomato icon) also have an highlight current line feature, that can still be active while your Visual Studio highlight option is turned off.
This drove me crazy! Find it in Visual Assist Option panel, Display category.
So don't forget to also uncheck the VisualAssist highlight option.
edit
my settings:
Visual Assist option turned off
Visual Studio option turned on (in the Text Editors part)
In the font color settings, for Highlight current line (active and inactive), set the foreground to Automatic
Finally you can set your highlight color as you want with the background color.
Last point, sometimes Visual Studio mess things up even more, you may have to restart it, or close/open your tabs... sadly, YMMV.
For VsCode 2021 version users
Workspace > Text-Editor > Render Line Highlight > none
Visual assist and vsvim extensions were conflicting. So I disabled it within the visual assist options.
Uncheck the option: Highlighting->Highlight results of Quick Find and Find in Files.
For some reason "esc" doesn't work .

Visual Studio 2010 - cannot find color setting for identifier-matching

I am looking for the option to set the background/highlight color for identifier-matches on Visual Studio.
For example, if I have an identifier:
int myNumber=0
Now, I put my cursor on into the middle of myNumber. Visual Studio highlights all other occurrances of myNumber on the page.
I cannot, for the life of me, find the color settings for this highlighting. At the moment in my color scheme it looks very much like the color for selected text. So, it is confusing and affects my productivity.
If anyone can track this down, you will be my hero.
It's a few months late, but the setting you're looking for is Highlighted Reference.
Since this comes up in the first Google search result, I'll also add that you may also have to enable the option if the colour you have selected isn't working. This is located in various places:
Text Editor, [Basic, C#], Advanced, "Highlight references to symbol under cursor"
Text Editor, C++, Advanced, "Disable Reference Highlighting"

Visual Studio: which setting to change for Find Next results in text editor?

Consider the Visual Studio's highly-customizable configuration of the text editor.
The value I'd like to tweak is the highlighting of the found search string. See circled below.
Question: in Visual Studio 2010 Beta 2, or Visual Studio 2008 which setting in the Fonts and Colors dialog box will allow the highlight/surround color to be changed?
Try changing Colors->Selected Text and Colors->Inactive Selected Text (in Tools->Options->Environment->Fonts)
There's a bug in Beta 2 that the results of a Find operation are highlighted with the inactive selection color instead of the active selection color (as Orcas did). Post Beta 2, it should show up in the much more obvious blue (or whatever the active selection color is set to).
Other than that, it isn't separately configurable, as the highlight is the actual text selection and not a marker of some sort.

Resources