176

VS2010:

In VB I can place the cursor inside an existing method's parameter brackets and type a 'space', which will bring up the tooltip with description of the parameter I'm at. This is not the case in C#. I have to delete the whole brackets including the parameters, and retype the left bracket, for this tooltip to show. Is there some shortcut or setting to change this behavior? I tried hitting ctrl, shift, alt, but it has no effect.

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
bretddog
  • 5,411
  • 11
  • 63
  • 111

6 Answers6

335

Ctrl+Shift+Space will do what you want.

You might want to check out a poster of key bindings.

JYelton
  • 35,664
  • 27
  • 132
  • 191
Lloyd
  • 29,197
  • 4
  • 84
  • 98
  • 10
    AFAIK, this doesn't bring up parameter info where the caret is within the parentheses for the parameters. – spender Jan 31 '11 at 10:21
  • 4
    Looking at the chart, CTRL+Shift+Space looks like the one. – spender Jan 31 '11 at 10:23
  • Cool, I even printed it off myself :P – Lloyd Jan 31 '11 at 10:24
  • 3
    Thanks! That works. So then I assume it can not be changed to "automatic" behavior? Btw, here is similar link for VS2010: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=92ced922-d505-457a-8c9c-84036160639f&displaylang=en – bretddog Jan 31 '11 at 10:33
  • 2
    Also make sure you don't have Resharper installed, as it overrides this shortcut. If you do, you can remove the override in the `Tools > Options > Keyboard` menu: search for commands with "CodeSmart". – Protector one Jan 02 '15 at 11:09
  • 6
    What's this called? I would like to remap it. It seems to be `Edit.ParameterInfo` –  Jan 22 '15 at 23:32
  • I wanted the same thing for VS2015, in 2012 it would pop up after the first bracket, in my install of 2015 it didn't, but the ctrl+shift+space worked. Thanks – Chris Feb 05 '16 at 13:24
  • 1
    by default, Ctrl+Shift+Space corresponds to `Edit.ParameterInfo`. – aderesh Dec 10 '20 at 07:23
41

It's Ctrl-K Ctrl-I for VS2015. In case people from the future are wondering wandering.

off99555
  • 3,797
  • 3
  • 37
  • 49
18

I don't understand what you mean exactly. But I use this coding for method parameters tooltip.

/// <summary>
/// Do work function
/// </summary>
/// <param name="id">This is user's Id.</param>
/// <param name="name">This is user's Name.</param>
/// <param name="surname">This is user's surname. </param>
private void DoWork(int id, string name, string surname)
{ 
    // do stuff
}
Sam
  • 7,252
  • 16
  • 46
  • 65
Serkan Hekimoglu
  • 4,234
  • 5
  • 40
  • 64
8

Visual Studio 2019 with VsVim extension

Works both in NORMAL and INSERT modes, for C# and C++ with:

Ctrl+Shift+Space

Just make sure to place the caret right after the first parenthesis:

C#

"Value".Contains(|   <-- caret

C++

glClearColor(|  <-- caret
rbento
  • 9,919
  • 3
  • 61
  • 61
6
Ctrl + K, Ctrl + P

Worked for me where Ctrl + Shift + Space didn't. Perhaps due to Resharper?

Serkan Hekimoglu
  • 4,234
  • 5
  • 40
  • 64
someone
  • 61
  • 1
  • 1
2

The most reliable way to know it (due to plugins etc) is to look it up in settings.

  1. Open settings window: Tools -> Options
  2. Go to Environment -> Keyboard
  3. (optional) Filter commands via Show commands containing: field (e.g. type in "param" there)
  4. In VS 2017, 2019 and 2022 the name is "Edit.ParameterInfo" (default binding is CTRL + SHIFT + P)
  5. In ReSharper 2021 the name is ReSharper.ReShareper_ParameterInfoShow

Also here is a list of all shortcuts in MS docs, which has command names along with description. I find it easier to search commands there rather then inside in-app settings.

Alexander Malakhov
  • 3,383
  • 2
  • 33
  • 58