VB.NET IntelliSense:在 ENTER 自动完成时禁用换行符

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8977333/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 15:53:52  来源:igfitidea点击:

VB.NET IntelliSense : Disable newline on ENTER autocomplete

vb.netvisual-studiovisual-studio-2010intellisense

提问by asmo

When editing C# code in Visual Studio 2010, the ENTERkey makes IntelliSense complete the current suggestion, without adding a new line.

在 Visual Studio 2010 中编辑 C# 代码时,该ENTER键使 IntelliSense 完成当前建议,而无需添加新行。

In VB.NET, the default IntelliSense behavior for the ENTERkey is to add a new line after completing the current suggestion.

在 VB.NET 中,ENTER键的默认 IntelliSense 行为是在完成当前建议后添加一个新行。

How can I configure IntelliSense to change the VB.NET behavior to the C# one?

如何配置 IntelliSense 以将 VB.NET 行为更改为 C# 行为?

I already know that I could press TABor SPACE, but out of habit I always end up hitting ENTER(and changing line).

我已经知道我可以按TABSPACE,但出于习惯,我总是以击球ENTER(和换线)告终。

采纳答案by JaredPar

Unfortunately the set of trigger keys for intellisense completion is not a configurable item for VB.Net. There is no way in the default Visual Studio environment to change this behavior.

不幸的是,智能感知完成的触发键集不是 VB.Net 的可配置项。在默认的 Visual Studio 环境中无法更改此行为。

It would be possible to develop a plugin of sorts to accomplish this. However that's a pretty extreme measure.

可以开发各种插件来实现这一点。然而,这是一个相当极端的措施。

EDIT As of Visual Studio 2017, it is now possible to change this. See the answer below

编辑从 Visual Studio 2017 开始,现在可以更改此设置。看下面的答案

回答by Abdelilah El Aissaoui

UPDATE VISUAL STUDIO 2017:

更新视觉工作室 2017:

Now with Visual Studio 2017 you can change it. Tools -> Options -> Text Editor -> Basic -> IntelliSense. In Enter key behaviorselect Never add new line on enter

现在使用 Visual Studio 2017,您可以更改它。工具 -> 选项 -> 文本编辑器 -> 基本 -> IntelliSense。在Enter 键行为中选择Never add new line on enter

ANSWER FOR VISUAL STUDIO 2015 AND PREVIOUS:

VISUAL STUDIO 2015 及之前的答案:

Resharpermakes it possible overriding Visual Studio intellisense and using its own intellisense. It is the only way I've found. It has a 30 days free trial if you want to test it.

Resharper可以覆盖 Visual Studio 智能感知并使用它自己的智能感知。这是我找到的唯一方法。如果您想测试它,它有 30 天的免费试用期。