Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code: How to show Overloads in IntelliSense?

Tags:

I am working with the new asp.net core 1.0 framework on Visual Studio Code.

My question is, how do I traverse through all the overloads a method might have?

VS Code method overloads

like image 744
Akshay Khot Avatar asked Nov 06 '16 19:11

Akshay Khot


People also ask

How do I show IntelliSense code in Visual Studio?

You can trigger IntelliSense in any editor window by typing Ctrl+Space or by typing a trigger character (such as the dot character (.)

How do I enable IntelliSense in Visual Studio?

To access this options page, choose Tools > Options, and then choose Text Editor > C# > IntelliSense.


2 Answers

When at that stage you can just press ( and it will prompt you for the overloads.

Take this example:

enter image description here

I press ( and I get:

enter image description here

If I happen to change focus, I can go back into the call at this.M1( and press Ctrl+Shift+Space (or +Shift+Space on macOS) to get the overload prompt again:

enter image description here

Pretty much the same as Visual Studio.

This is in VS Code 1.7.1, C# 1.4.1 extension.

like image 87
DaveShaw Avatar answered Sep 17 '22 15:09

DaveShaw


I can't comment on the accepted answer but in case anyone has the problem Dawson B mentioned, where you can't navigate the little window of overloads with the vim extension enabled, I found a solution. It was difficult to figure out what that window is called as it's not easy to google, but it is apparently a ParameterHint.

Open the Keyboard Shortcuts with Ctrl+K Ctrl+S, search for "hint", click the pencil to the left of showNextParameterHint, change to Alt+N, and showPrevParameterHint to Alt+P, to not interfere with the Ctrl+N/P binding to Intellisense suggestion navigation. Of course if these conflict with some other extension/custom binding you have, pick whatever works best.

like image 33
Evan Callicoat Avatar answered Sep 21 '22 15:09

Evan Callicoat