ReSharper:如何不在关键字后插入空格,或完全禁用格式

发布于 2024-11-06 20:09:26 字数 338 浏览 5 评论 0原文

例如,当我键入“i​​nternal”并在自动完成列表项上按 Enter 时,会在单词后自动插入一个空格,即:“internal”。有没有办法禁用这种行为?

或者,更好的是,也许有一种方法可以完全禁用 ReSharper 的代码格式化“部分”?我确实喜欢它的代码检查功能和工具,但我认为习惯它的自动格式化功能是一个坏主意。

编辑:

要明确的是,这里的自动格式化,我的意思不是整个文档格式(这确实是一个很好的功能),而是自动完成其中的一部分,即然后您选择自动完成中的“Close”ReSharper 生成“Close();\n”,而标准 VS 输出将为“Close”。

When I type, for example, 'internal' and press Enter on autocomplete list item, a space is inserted automatically after the word i.e.: 'internal '. Is there a way to disable this behaviour?

Or, even better, maybe there is a way to disable completely code formatting "part" of ReSharper? I do like its code inspection features and tools, but I think it's a bad idea to get used to its autoformatting features.

Edit:

To be clear, by autoformatting here, I mean not whole document formatting (which is indeed a good feature), but rather autocomplete part of it, i.e. then you select 'Close' in autocomplete ReSharper produces 'Close();\n' while standard VS output will be 'Close'.

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

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

发布评论

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

评论(2

野稚 2024-11-13 20:09:26

发生这种情况是因为默认情况下启用 ReSharper 智能感知。如果将其切换到 VS intellisense(ReSharper - 选项 - 环境 - Intellisense),此行为将会消失(以及所有 ReSharper intellisense 改进)。

This happens because ReSharper intellisense is enabled by default. If you switch it to VS intellisense (ReSharper - Options - Enviroment - Intellisense), this behavior will disappear (and all ReSharper intellisense improvements too).

怂人 2024-11-13 20:09:26

您可以尝试查看屏幕截图中突出显示的区域,看看是否对您有帮助。我不知道有什么其他方法可以禁用自动完成。

FWIW,我同意 Holstebroe 和 Roger 的观点,您应该找到适合您和您的团队的自动完成设置,而不是禁用它们。通用的代码格式真的很好。

You can try looking under the highlighted areas in the screenshot and see if that helps you. I don't know any other way to disable auto completion.

FWIW, I agree with Holstebroe and Roger that you should find auto complete settings that work for you and your team instead of disabling them. Common code formatting is really nice to have.

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