Wookai
Wookai

Reputation: 21723

How to get parameter hints/completion in Visual Studio?

I usually use Eclipse for coding, which has a pretty nice parameters completion feature: when you are calling a method, just after you typed (, it will show you the list of parameters, and highlight where you are as you type:

Example of parameters completion in Eclipse

How can I get similar help in Visual Studio 2012?

I know that Ctrl + K, Ctrl + I shows some info about what your cursor currently highlights, but it doesn't work if you already have started typing something. If I type MyMethod(arg1, and then hit the shortcut (or any other, such as Ctrl + Space or Ctrl + Shift + Space), I don't get anything useful.

Upvotes: 23

Views: 38940

Answers (4)

Ogglas
Ogglas

Reputation: 69928

Since Visual Studio 2019 you can get inline parameter name hints as well. It can be activated under Text Editor -> C# -> Advanced. Check Display inline parameter name hints.

enter image description here

Parameters will then show up like this in UI:

enter image description here

Upvotes: 2

Shane.A
Shane.A

Reputation: 136

visual studio 2019

you can add a button to tool bar:

view>toolbar> text editor.

Then:

view>toolbar>Customize:

Select commands tab.

Select Toolbar radio button.

On toolbar dropdown select Text Editor.

command location Press "add new command.

Select Edit [wait to populate].

Select parameter Info. command image.

Hope this helps.

Upvotes: 0

Rosdi Kasim
Rosdi Kasim

Reputation: 25956

For my case, neither Ctrl+Shift+Space nor Ctrl+K+P work.. eventually I nailed it down to this settings:

Visual Studio Text Editor Intellisense

Now whenever I typed (, intellisense will automatically pop up!.. nice!

As it turned out, this is caused by Resharper..., the Resharper uninstall doesn't correctly restore the original Visual Studio settings.

Upvotes: 7

Simon Whitehead
Simon Whitehead

Reputation: 65049

You can use:

Ctrl+Shift+Space. This brings up the argument list for a method your cursor is currently in.

Example:

typing

Pressing Ctrl+Shift+Space with the cursor after "a", results in:

ctrlshiftspace

You can check this is properly assigned in the keyboard settings, as Edit.ParameterInfo:

assigned

Upvotes: 53

Related Questions