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

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)

Related

Resharper uses different code style than Visual Studio

I am using VS2017 RC to write C# and have lately added Resharper Ultimate. However, Resharper Ultimate seems to ignore the code style I have set in Visual Studio and instead use another (probably the default C#) code style. Since Resharper often auto applies its code style, this is very annoying. I verified that it is indeed resharper by doing this:
Select some code, hit Edit -> Advanced -> Format Selection:
This is the visual studio formatter and it formats my code as desired
Select some code, hit Alt+Enter -> Format Selection:
This is Resharper's format command, and it messes up my codestyle.
So my questions are:
How can I tell resharper to use VS's code style?
If this is not possible, then where can I change the code style that resharper uses, so I can at least adjust the code style manually.
Why does Resharper have its own code style in the first place? Wouldn't it make a lot more sense to always use VS's code style?
As for question #3:
Why does Resharper have its own code style in the first place? Wouldn't it make a lot more sense to always use VS's code style?
I haven't compared the features of Resharper with recent Visual Studio versions in depth, but compared with older versions such as VS2010, the Resharper formatting engine is light-years ahead. Much more settings and flexibility to accomplish the formatting you want (and many sane defaults though that could be a matter of opinion of course). It has been enhanced even more in the 2017/2018 releases.
Resharper can also save the formatting settings to several layers of shared configuration files (committed to VCS) to make sure everyone automatically follows the same rules. This also allows for different rules to apply for different projects.

Hide Properties for Ctrl+Comma (Navigate to) in Visual Studio?

I'm a big fan of the Navigate to window (Ctrl + Comma) to navigate to classes and files.
Problem for me is that it also shows Properties, Fields and Methods that match your keyword.
In a large codebase that means the navigate to window is flooded with members while I'm mainly using this to look for Classes.
Question:
Is it possible to hide Properties and other Members in the 'Navigate to' window?
I've looked into Settings but with no luck to this moment.
Note: I'm not using Resharper and looking for a Visual Studio native solution
In Visual Studio 2017 they've added a really useful feature where you can type an 'f' in front of your search to only look for files.
Like: f banana pancakes searches for only files with banana pancakes. You can also use t for types and there are some other really good new options.
This is available also for the community edition. If you're using an older version of Visual Studio I recommend taking the effort to upgrade.

Highlight all references to X?

The Eclipse IDE has a neat little feature that I really miss in Visual Studio.
If I place the cursor on a variable or method name, the IDE will automatically highlight all references to it in the current document within the relevant scope.
I can't seem to find an option to turn on similar behaviour in VS2008 or Resharper 4. I know VS has a Find Usages function, but I'd like to do it automatically on the fly.
Does anyone know of a free addin which will add this functionality?
If you're using ReSharper, you can highlight the usages in the file with Shift-Alt-F11. Place your cursor on the variable you want to find usages of, and press the Shift-Alt-F11 combination.
There is an add-in for Visual Studio that will do something similar called RockScroll.
When you double click on something, it will highlight all occurrences of the item you double clicked. It also changes the vertical scrollbar to a "syntax highlighted thumbnail view" showing an overview of where the item occurs in the file.
I know you mentioned ReSharper, but CodeRush has a nice references window that you can dock and let it search for things on-the-fly or on demand. As a bonus, you can select each usage and it will show you the context surrounding the usage. It also works for methods.
I mentioned CodeRush since they have an express edition, which looks like it includes that feature, but I haven't tried that edition.
Visual Studio 2010 has sorta implemented this, but the feature is somewhat lacking. There is a non-configurable delay between placing the cursor and highlighting.
The RockScroll Addin is not available for Visual Studio 2010 and above.
As a replacement, the free "Highlight all occurrences of selected word" plugin will highlight all occurences of the selected string after a doubleclick. There is no delay as with the native vs2010 highlighter.
It is string-based, which means it works inside comments and string literals.
Microsoft published a tool that sort of does what you want.
Some of my favourite features:
Enhanced Scrollbar
Auto Brace Completion
Ctrl + Click Go To Definition
Open Containing Folder
and the list goes on.
For Visual Studio 2010 and for Visual Studio 2012

Customizing Visual Studio's Intellisense

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

In Visual Studio 2008, how can I make control+click do a "Go To Definition"?

In the Delphi IDE, you can hold control and click on a method to jump to its definition. In VS2008, you have to right-click and select "Go To Definition".
I use this function quite often, so I'd really like to get VS to behave like Delphi in this regard - its so much quicker to ctrl+click.
I don't think there's a way to get this working in base VS2008 - am I wrong? Or maybe there's a plugin I could use?
Edit: Click then F12 does work - but isn't really a good solution for me.. It's still way slower than ctrl+click.
I might try AutoHotkey, since I'm already running it for something else.
Edit: AutoHotkey worked for me. Here's my script:
SetTitleMatchMode RegEx
#IfWinActive, .* - Microsoft Visual Studio
^LButton::Send {click}{f12}
Not for Visual Studio 2008, but if you upgrade to Visual Studio 2010, you can use the free
Visual Studio 2010 Pro Power Tools from Microsoft to achieve this.
You could create an Autohotkey script that does that. When you ctrl-click a word, send a doubleclick then a F12.
I don't have AHK handy so I can't try and sketch some code but it should be pretty easy; the AHK recorder should have enough features to let you create it in a point 'n' click fashion and IIRC it is smart enough to let you limit this behaviour to windows of a certain class only.
When you have your script ready just run the script in the background while you code. It takes just an icon in the Notify bar.
Visual Studio 2008 defaults this to F12, but you can set it in Tools | Options | Environment | Keyboard, and change Edit.GoToDefinition - however, I'm not sure how you can get it to CTRL+mouseclick.
Resharper does that but it's not free.
Highly recommended plugin though, most experienced .NET developers use it.
Just a quick note that the following AutoHotkey script works for me in Visual C++ 2010 Express.
SetTitleMatchMode 2
#IfWinActive, Microsoft Visual C++ 2010 Express
^LButton::Send {click}{f12}
I also changed the shortcuts for View.NavigateForward and View.NavigateBackward to Alt+Right/Left Arrow since I am used to Eclipse.
Yes, both Resharper (a must have!) and Productivity Power Tools have this feature.
Interesting quirk, though.
If you just go with the defaults on both tools (if you install both tools) you can experience a frequent double-jump problem (jump to definition from where you first click and then jump again from what your cursor is above upon getting to that first definition) until you turn off one of the Ctrl-Click features of these add-ons.
Put the mouse cursor on the method name or any identifier, and press F12

Resources