C# 如何在 Visual Studio 中获取参数提示/完成?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17582134/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to get parameter hints/completion in Visual Studio?
提问by Wookai
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:
我通常使用 Eclipse 进行编码,它有一个非常好的参数补全功能:当你调用一个方法时,在你输入 之后(,它会显示参数列表,并在你输入时突出显示你所在的位置:


How can I get similar help in Visual Studio 2012?
如何在 Visual Studio 2012 中获得类似帮助?
I know that Ctrl + K, Ctrl + Ishows 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 + Spaceor Ctrl + Shift + Space), I don't get anything useful.
我知道这会Ctrl + K, Ctrl + I显示有关光标当前突出显示的一些信息,但如果您已经开始输入某些内容,则它不起作用。如果我输入MyMethod(arg1,然后点击快捷方式(或任何其他方式,例如Ctrl + Space或Ctrl + Shift + Space),我不会得到任何有用的信息。
采纳答案by Simon Whitehead
You can use:
您可以使用:
Ctrl+Shift+Space. This brings up the argument list for a method your cursor is currently in.
Ctrl+ Shift+ Space。这会调出光标当前所在方法的参数列表。
Example:
例子:


Pressing Ctrl+Shift+Spacewith the cursor after "a",results in:
在光标后按Ctrl+ Shift+结果:Space"a",


You can check this is properly assigned in the keyboard settings, as Edit.ParameterInfo:
您可以检查这是否在键盘设置中正确分配,如Edit.ParameterInfo:


回答by Rosdi Kasim
For my case, neither Ctrl+Shift+Spacenor Ctrl+K+Pwork.. eventually I nailed it down to this settings:
对于我而言,既不Ctrl+ Shift+ Space,也不Ctrl+ K+P的工作..最终我钉下来到这个设置:
Now whenever I typed (, intellisense will automatically pop up!.. nice!
现在,每当我输入时(,intellisense 都会自动弹出!.. 太好了!
As it turned out, this is caused by Resharper..., the Resharper uninstall doesn't correctly restore the original Visual Studio settings.
事实证明,这是由 Resharper 引起的...,Resharper 卸载无法正确恢复原始的 Visual Studio 设置。
回答by Shane.A
visual studio 2019
视觉工作室 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 locationPress "add new command.
命令位置按“添加新命令。
Select Edit [wait to populate].
选择编辑 [等待填充]。
Select parameter Info. command image.
选择参数信息。 命令图像。
Hope this helps.
希望这可以帮助。

