Customizing Visual Studio's Intellisense - visual-studio

A recent project had me working with C# again, and I noticed something I hadn't before -- C#'s Intellisense shows possible exceptions that can be thrown when calling a method
Since I work mostly with VB.NET applications, it'd be really nice to have this feature in those applications as well, but it's unfortunately absent from VB's Intellisense
Is there any quick and easy way I can customize Visual Studio's Intellisense to show exceptions (as well as other members from the XML comments)? Or am I looking at a full modification using the SDK?
Update: 29-Sep-2008 1:49 PM -- I figure this will be more complicated than simply changing a configuration setting. Since the comments are XML-based, I was hoping for an XSLT file somewhere buried in the Visual Studio directory, but nothing has turned up so far. Looks like I'm going to have to dig into the Visual Studio SDK.

Try going to Tool -> Options...
Then Text Editor -> Basic
and make sure both options "Auto list members" and "hide advanced members" are unchecked.
Also check "Parameter information".
I cannot validate this information because my current Visual Studio installation is C# standalone.
Regards,
Luís

Related

Refactor on save in Visual Studio 2019

I love Prettier for VS Code. I want to do similar things in Visual Studio (2019).
It now has 'Wrap, indent, and align parameters or arguments' for example (https://learn.microsoft.com/en-us/visualstudio/ide/reference/wrap-align-indent-parameters?view=vs-2019); and I'd like to do this automatically whenever I save the file.
Does anyone know if this is possible? Or if there's a free extension that can do this?
Mads Kristensen (a Microsoft employee who makes scads of Visual Studio extensions and teaches you to too!) made a JsPrettier extension for "classic" Visual Studio (ie, not VS Code):
https://github.com/madskristensen/JavaScriptPrettier
It does not format on save if you set that up in its settings.
If it's literally Prettier in Visual Studio that you're after, this isn't a bad option.
I don't know of a free plugin but you can get quite a long way towards this with some muscle memory and the built in autoformat command.
CTRL+E, CTRL+D, CTRL+S
will do code indentation and formatting, and save the file.
If you have Resharper (sorry), there's a configurable code cleanup tool which will do what you want and CTRL+E, CTRL+F, CTRL+S will do the cleanup and save.
The Format document on Save VS extension does exactly what you want, with one exception. It automatically runs Visual Studio's code cleanup command on save.
Visual Studio's code cleanup commands covers many code style preferences and can be configured with a .editorconfig file. Unfortunately one thing that is not supported by VS yet (not counting Resharper) is line wrap preferences. There is an open ticket for this: dotnet/roslyn#33872
If and when Roslyn supports line wrap preferences (presumably as a new .editorconfig preference), then Visual Studio code cleanup will enforce it and the extension will apply it on save.

Visual Studio's 'Go To Definition' doesn't work on javascript libraries

I'm using visual studio to edit a basic webpage I'm making, which uses the VisJS library. Intellisense magically works:
However, on that same object when I try to 'Go To Definition', it can't find it:
It would also be really nice to see what parameters the Network constructor takes as well.
How do I get this to work?
I experienced a similar problem on Visual Studio 2017, where Go To Definition wasn't working with JavaScript files.
The solution was going to:
Tools > Options > Text Editor > JavaScript/TypeScript > Language Service
There are 2 checkboxes there, one of them is:
Disable dedicated syntax process (restart required)
I unchecked it, restarted VS, and F12 then worked as usual.

Refactor menu missing from Visual Studio 2015

I am having trouble finding the right-click context menu in Visual Studio 2015. I know that nothing is wrong with my project or the file I am working. I can find the right-click context refactor menu in Visual Studio 2013. However, in Visual Studio 2015 there isn't a refactor context menu in the right-click context menu.
Where did it go? How do I get it back?
Your suggestion cannot include menu Edit → Refactor.
I have tried to reset my Visual Studio settings back to default using menu Tools → Import and Export Settings and that didn't bring the menu back either.
Some of the refactoring tools have been relocated or are at least accessible in a different manner than they were previously.
Using the extract method refactor as an example, you can still use this function; it is just not done the same as before:
Right click
Quick actions
Click extract Method
I think they've changed it to feel more "ReSharper"ey. All of the functionality should still be there however.
Here's more information on refactoring in Visual Studio 2015 - hopefully this helps! Refactoring (C#)
You no longer need to access the refactoring using the mouse right click.
It is recommended that you use the keyboard shortcut keys within Visual Studio.
For all possible shortcut keys, see Default Keyboard Shortcuts in Visual Studio, Refactor.
You might need to build the project to get it to work.
See Code Editing ASP.NET Web Forms in Visual Studio 2013 | Microsoft Docs. (If it is missing then the point is that I am using an example provided by Microsoft.). In Refactoring and Renaming see To extract a method in a C# page. When I follow the instructions I cannot find the feature to extract the code to a method. When I tried the Edit menu it said I did not have valid code. Then I built the project and the feature to extract the code was available and worked.
If you change the name of the object you are refactoring, the light bulb then appears to the left which asks if you wish to change the name of the object (i.e. refactor) or generate a new constructor for the new named object.
Ctrl + . is the shortcut key for extracting a method in Visual Studio 2015 and onward.
Ctrl+M, R does not work anymore in new versions.

Visual Studio Missing stuff in Tools Options

So I started using VS 2013 over a year ago now, but I never noticed I was missing options until I tried to use TypeScript and set the "Automatically compile ..." to true.
The only (Tools -> options -> text) Editor items I have are (General, JavaScript, CSS Advanced, HTML). (See Pic)
I am also missing a lot of other things in Options that everyone else seems to have.
I thought maybe I just didn't include stuff when I installed, but when I go to add optional features through (Add Remove Programs -> Modify) everything is checked except "Blend for Visual Studio". (See Pics)
I can't find anything on the web relating to my problem. Can anyone give me some direction.
I do see a "Show all settings" checkbox at the bottom, did you try checking this?
I don't personally use visual studio but I know there are differences between version offerings. https://www.visualstudio.com/en-us/products/compare-visual-studio-products-vs.aspx
Have you checked which versions those with these options are using?

Can I make Visual Studio's code completion window more like Eclipse (Java)?

Is it possible to make Visual Studio 2010's code completion window more like that of Eclipse (Java)?
In particular, I'd love the code completion window to give me a variable's type, and a method's return type and expected parameters, without needing to hover the highlight over that particular variable/method. Here's Eclipse's:
VS's code completion's little icons that indicate if something is a property, method etc are useful, but they just aren't enough.
Unfortunately, there's no built-in way to do this. Visual Studio offers only very limited options related to customizing its Intellisense display.
You'll have to turn to third-party solutions or add-ins, or settle down to write your own using one of the existing options as a guide. Here are a few that can be found around the web:
Visual Studio Intellisense Presenter (looks like it might be very close to what you're looking for)
CSharpIntellisensePresenter
Visual Assist X (commercial software with 30-day free trial)

Resources