如何使用 Visual Studio 禁用不需要的自动完成功能 +锐锐器?

发布于 2024-10-31 08:51:38 字数 494 浏览 3 评论 0原文

我使用的是 Visual Studio 2010 和 ReSharper 5。

我在 .cs 文件的顶部定义了它。

#if X86
using size_t = System.Int32;
#else
using size_t = System.Int64;
#endif

然后我可以使用 size_t 并知道它是一个本机整数,如果编译为 32 位程序集则为 32 位,如果编译为 64 位程序集则为 64 位。 (对于那些好奇的人,替代方案始终使用 Int64,或者在运行时在 IntPtr.Size == 4 上分支,并且有两个版本的代码。我更喜欢这个解决方案。)

但是,如果我输入 size_t 并按空格键,它将自动转换为 Int64(如果定义了 X86,则转换为 Int32)。显然这是不可取的。

我进入 ReSharper 选项,进入环境\智能\完成行为,并禁用“自动完成单个项目:”下的所有复选框。

它仍然发生,我还能尝试什么吗?

I'm using Visual Studio 2010 and ReSharper 5.

I define this at the top of a .cs file.

#if X86
using size_t = System.Int32;
#else
using size_t = System.Int64;
#endif

Then I can use size_t and know that it is a native integer, 32 bits if compiled as a 32 bit assembly, and 64 bits if compiled as a 64 bit assembly. (for those that are curious, the alternatives are always use Int64, or branch at runtime on IntPtr.Size == 4 and have two versions of the code. I prefer this solution.)

However, if I type size_t and hit space, it will be automatically converted to Int64 (or Int32 if X86 is defined). Obviously that's undesirable.

I went into ReSharper options and went to Environment \ Intellisence \ Completion behavior and disabled all the checkboxes under "Automatically complete single item with:".

It still happens, is there anything else I can try?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

永不分离 2024-11-07 08:51:38

我遇到了类似的问题(使用 VS2013 和 Resharper 8.2)。

为了阻止每次“空格”命中时出现不需要的自动补全,我必须在 VS 和 R# 选项中禁用“空格”上的 IntelliSense 补全:

  1. VS > >工具>选项>文本编辑器> C#>智能感知>
    “按空格键提交”复选框
  2. VS>重磨器>选项>环境>智能感知>完成字符> C#“在空间上完成”复选框

干杯!

I ran into a similar issue (using VS2013 and Resharper 8.2).

To stop the undesirable auto-completion on every "space" hit, I had to disable IntelliSense completion on "space" both within VS and R# options:

  1. VS > Tools > Options > Text Editor > C# > IntelliSense >
    "Committed by pressing the space bar" checkbox
  2. VS > Resharper > Options > Environment > IntelliSense > Completing Characters > C# "Complete on space" checkbox

Cheers!

对你的占有欲 2024-11-07 08:51:38

一种解决方案是切换到智能感知的建议完成模式。切换的默认键绑定是 Ctrl+Alt+Space。在建议模式下,如果您明确选择要更改的值,它只会更改您键入的内容。您可以在这里阅读更多相关信息:

http://blogs .msdn.com/b/zainnab/archive/2012/05/01/9943045.aspx

在 VS2017 菜单层次结构中,可以在以下位置找到建议模式:

Edit -> Intellisense -> Toggle Completion Mode

此外,当启用建议模式时,它会通过以下方式直观地指示以下按钮(也可以通过单击该按钮启用/禁用):

Visual Studio 2017 建议模式按钮

One solution would be to toggle to suggestion completion mode for intellisense. The default key binding for the toggle is Ctrl+Alt+Space. When in suggestion mode, it will only change what you type if you explicitly choose a value to change to. You can read more about it here:

http://blogs.msdn.com/b/zainnab/archive/2012/05/01/9943045.aspx

In the VS2017 menu hierarchy the suggestion mode can be found under:

Edit -> Intellisense -> Toggle Completion Mode

Additionally when the suggestion mode is enabled, it is visually indicated by the following button (and can also be enabled/disabled by clicking the button):

visual studio 2017 suggestion mode button

仲春光 2024-11-07 08:51:38

默认情况下关闭 IntelliSense 选项

在“工具”菜单上,单击“选项”。

选择文本编辑器文件夹。

选择要自定义 IntelliSense 的语言的文件夹。

在常规属性页中,清除您不需要的 IntelliSense 功能的复选框:

自动列表成员适用于列表成员

参数信息适用于参数信息

To turn IntelliSense options OFF by default

On the Tools menu, click Options.

Select the Text Editor folder.

Select the folder for the language you want to customize IntelliSense.

In the General property page, clear check boxes for IntelliSense features that you do not want:

Auto list members applies to List Members

Parameter information applies to Parameter Info

雪化雨蝶 2024-11-07 08:51:38

在 VS 2019 和 ReSharper 2020 中,切换完成模式无法解决问题 - 当按下空格键时会应用建议。
要使其正常工作,必须转到:

Extensions -> ReSharper->选项... ->智能感知 ->完成字符

并取消选中相应编程语言的在空间上完成

< img src="https://i.sstatic.net/K7dgC.png" alt="ReSharper IntelliSense 设置">

In VS 2019 and ReSharper 2020 toggling completion mode doesn't solve the issue - suggestions are applied when spacebar is hit.
To have it working one has to go to:

Extensions -> ReSharper -> Options... -> IntelliSense -> Completing Characters

and uncheck Complete on space for a respective programming language

ReSharper IntelliSense settings

这样的小城市 2024-11-07 08:51:38

您可以使用退出键取消当前的智能感知建议。

You can use the escape key to cancel the current intellisense suggestion.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文