Hide code editor overlays in Visual Studio 2015 [duplicate] - c#

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.

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

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

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.

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

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

Related

Disable if, for, while, etc. outlining in Visual Studio 2017 for C#

I've noticed that Visual Studio 2017 automatically outlines C# block statements unlike Visual Studio 2015. I couldn't find a setting for this. Is there any way to disable it?
Go to Edit tab --> Outlining --> Stop Outlining.
It sounds like you are describing Structure Guidelines which are a new feature enabled by default in Visual Studio 2017.
According to this MSDN blog:
You can enable and disable this feature in Tools->Options. Look for
“Show structure guide lines” under Display in the Text Editor options
page.
You can disable it using
Tools > Options > Text Editor > C# > Advanced
Then untick enable outlining as shown in image:
If you looking at the "guide lines"
Tools -> Options -> Text Editor -> General -> Show structure guide lines
BUT, I generally find this useful. Do you really want to turn this off ?
Just moved to VS 2017 and I believe the answer to this is that when you collapse all of your code, 2017 also now includes items in each method such as 1
to change this you need to go to Tools > Options > Test Editor > C#/Basic > Advanced and uncheck Show Outlining for Code Level Construct. 2

Visual Studio 2017 xaml designer not available

Using Visual Studio Professional 2017 (Release 15.2 26430.16), when I open a xaml file for a desktop UI that I have developed, I can no longer see the xaml designer (I only see the raw xaml code). This is new behaviour and may be due to me having a system clean-out, so maybe I removed an SDK that I need or something like that?
Are there any Visual Studio error logs I can check for warnings etc?
Frankly, your situation is different than mine. In my situation, it was because of Resharper. Maybe this may useful for someone else.
What to do is checking Resharper Options > Enviroment > Performance Guide > Disable XAML Designer.
It must be set to "Ignore" or "Show in Status Bar". Otherwise, it will always disable XAML Designer.
In the Visual Studio 2017 Installer, I selected all of the SDKs and installed the missing ones. This did not fix the problem by itself, but a subsequent 'repair' from the Visual Studio 2017 Installer (available from the 'hamburger' drop-down) did.
Sometimes, adding or removing SDKs from the Installer toggles the 'Enable XAML Designer' check box under Tools -> Options -> XAML Designer -> General (or perhaps it was the repair step that turned this back on), so ensure that this is checked.
Make sure XAML Designer is enabled.
Tools -> Options -> XAML Designer -> General -> Enable XAML Designer
I couldn't get the designer to work, but I found an alternate solution posted here, posted by #DamianSuess
Use the View > Other Windows > Xamarin.Forms Previewer menu in
Visual Studio to open the preview window. Use the Window > New
Vertical Tab Group menu to position it side-by-side.
forms-not-show-in-visual-studio
I know this issue is tagged as WPF but I had a similar issue for Xamarin Forms.
What solved this issue for me:
Right Click the xaml file
Select "Open With..."
Select Xamarin.Forms Previewer
Click OK
Optionally, you can set the Xamarin.Forms Previewer as the default for xaml files
make sure you have correctly installed the Windows 10 SDK, there are 3-4 versions of the SDK, the error you are talking about can also be a consequence of a incompatible sdk,
also reinstall the sdk related to your app, close every process related to Visual studio running in background while reinstalling the SDK.
Can you share a screenshot of the xaml designer page?
I had the same, I found that opening the XAML in VS community did not work. However, if I choose file -> open -> project/solution and open the corresponding sln file, it works.

Show current method/block/region in Visual Studio plugin

I'm sure I used to be able to see the name of the current class and method when editing vb.net files - I can't see anything similar in VS 2015 Update 3.
Does anyone know if there's a plugin that would show me this info? Being able to see the name of the current region would be brilliant, too.
Thanks.
You don't need a plug-in; this feature is built into Visual Studio and has been since at least VS 2005. (Actually, it originated in the classic Visual Basic editor and was ported over to Visual Studio when the IDEs were integrated.) I'm not sure how it got disabled on your machine, since it is enabled by default.
Go to Tools → Options → Text Editor → Basic (or any language you want), and ensure that the "Navigation bar" option at the bottom is checked.
This will give you a bar at the top of your text editor window that displays the class and method names. It doesn't, however, display the region.
You can see the current region in "Visual Assist" extension.
You should download it from Nuget.(Tools --> Extension And Updates and then search the Visual Assist).
After you'll install it, You'll see a new tab called: "VA Outline" it's located near the Solution Explorer tab.

Developing for ASP.Net MVC, Visual Studio tab names are meaningless

For all Visual Studio ASP.Net MVC developers - I'm sure you've faced this problem before:
In each one of my controllers, there is usually an Index, Create, Edit and Detail views. All of the default view files generated by ASP.Net's scaffolding are all given the same name, for example: index.cshtml. Granted, they're in different folders.
So it's really easy to get lost in Visual Studio when you have four or five tabs open, all with the same name! Is there a way/plugin to get visual studio show me something more meaningful, such as the controller name/view folder? Or do you developers just rename all of your files once they're generated? I already have resharper so bonus points if it's possible with that.
FYI If you just hover over the tab, it tells you what View/Folder it is in. That's one way to differentiate between the different tabs.
I use this plugin https://visualstudiogallery.msdn.microsoft.com/2e8ebfe4-023f-4c4d-9b7a-d05bbc5cb239 with VS2013 and VS Community 2015.
What I usually do so far is Ctrl+N with resharper:
The Productivity Power Tools extension has a custom document well that lets you color code the tabs. It is usually used to color code them by the project they are in, but it also allows you to use custom regex. You could disable the project based color coding and add custom regexes to color any document tab with "Edit" in the path Blue, and documents with "Create" Green, etc... You will need to turn on the option for "Use full document path for regular expression matching" under the "advanced" tab of the power tool options.
The VS add-in Tabs Studio works for me.
After installing open the Tab Studio add-in manager and select the Disambiguator add-in, i.e.:
Will then give you tabs like this:
Note: it costs $49 after the 30 day trial...

How to filter by type in IntelliSense?

I want to see only the events for a given object. But when I use IntelliSense shows all members.
One of the features of a Visual Studio addin, called Visual Assist X, is the enhanced IntelliSense, which allows you to filter by events, properties, methods, etc:
It's not exactly what you asked, but it's pretty close.
I think it's not possible out of the box for c# code, see msdn and stackoverflow.
For some obscure reason filtering does work in the xaml Editor.
With Resharper you have the filter functionality though.
In Visual Studio 2017 check this option:
Tools -> Options -> Text Editor -> C# -> IntelliSense -> Show completion item filters.
You may use icons or shortcut keys to filter particular categories. Unfortunately, I found this option only in C# and Basic. I expect it in XAML.
IIRC, ReSharper supports this.
The new version of Visual Studio (Today it's named "Visual Studio 15 Preview 3", it should be renamed as VS 2016 or VS 2017 later...) natively support this feature. It was presented in Build 2016, take a look at this video of the presentation in the exactly time that they talked about it:
https://www.youtube.com/watch?v=RNpFHbEaNpU#t=2644
The latest version of visual studio has buttons in intellisense widnow, to filter based on property, event or method. Please see the screenshot below:

Categories

Resources