在 Visual Studio 2015 中按空格键时停止默认自动完成行为 [英] Stop default Autocomplete behavior when hitting spacebar in Visual Studio 2015

查看:38
本文介绍了在 Visual Studio 2015 中按空格键时停止默认自动完成行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

注意这里的关键字是默认".我知道我可以逃脱并且默认行为被中止.我不想每次 IDE 认为它知道我想要什么时都按转义键.2013 年我不必这样做.

NOTE The keyword here is "default". I know I can hit escape and the default behavior gets aborted. I don't want to hit the escape key every time the IDE thinks it knows what I want. I didn't have to do this in 2013.

ADDENDUM 2 看来我在这里仍然难以传达我想要的东西.当我按下空格键时,我想要发生的事情是 nothing...我只想在我的屏幕上显示一个空格字符.我希望 IDE 真正插入建议的唯一一次是当我点击标签栏时.我希望这更清楚?

ADDENDUM 2 It seems I'm still having difficulty communicating what I'm after here. What I want to happen is nothing when I press the space bar... I just want a space character to show up on my screen. The only time I want the IDE to actually insert a suggestion is when I hit the tab bar. I hope that's clearer?

这让我发疯了.2013 年及之前允许您设置完成字符(也许那是更清晰的?),但在 2015 年,我认为没有办法停止自动完成的默认行为.

This is driving me nuts. 2013 and before allowed you to set completion characters (maybe that was resharper?) but in 2015 I see no way to stop the default behavior of autocomplete.

例如,假设我有一个类 Foo,但我还没有指定命名空间,但我在指定命名空间之一中有一个类 FooBar,如果我输入:

For example, say I have a class Foo, but I don't have the namespace specified already, yet I have a class FooBar in one of the specified namespaces, if I type:

public void DoSomething(Foo// <-- then a space)

...它会自动放置 FooBar.我该如何关闭这种行为?

...it automatically puts FooBar. How the heck do I turn off this behavior?

我应该提到我仍然想要自动完成,只是在标签上.

I should mention that I still want AutoComplete, just on tab though.

推荐答案

Edit -> Intellisense -> Toggle Completion Mode

Edit -> Intellisense -> Toggle Completion Mode

来自:https://msdn.microsoft.com/en-us/库/hcw1s69b.aspx

"您也可以更改为建议模式,在该模式中,仅将您键入的文本插入代码中.例如,如果您输入不在列表中的标识符并按 TAB,则在完成模式下,该条目将替换键入的标识符.要在完成模式和建议模式之间切换,请按 CTRL+ALT+SPACEBAR 或单击编辑/智能感知/切换完成模式."

"You can also change to suggestion mode, in which only the text you type is inserted into the code. For example, if you enter an identifier that is not in the list and press TAB, in completion mode the entry would replace the typed identifier. To toggle between completion mode and suggestion mode, press CTRL+ALT+SPACEBAR or click Edit/IntelliSense/Toggle Completion Mode."

这篇关于在 Visual Studio 2015 中按空格键时停止默认自动完成行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆