How to get parameter hints/completion in Visual Studio?

折月煮酒 提交于 2019-11-30 01:19:29

问题


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:

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.


回答1:


You can use:

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

Example:

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

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




回答2:


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

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.



来源:https://stackoverflow.com/questions/17582134/how-to-get-parameter-hints-completion-in-visual-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!