选项卡的行为Resharper Intellisense选项

问题描述:

像Resharper这样的产品具有许多设置,但我似乎找不到合适的设置来获得我想要的确切行为.

A product like Resharper has many settings, and I can't seem to find the right settings to get the exact behavior I desire from it.

我要更改的行为是这样的: 假设我想要的结果是

The behavior I am trying to change is this: Suppose the endresult I want is

但当前行是

如您所愿,我开始输入:

As you expect I start typing:

在标签页之后,我得到了

and after a tab I get this

但我希望它成为

有人知道我如何以实现我期望的行为的方式更改Resharper设置吗? 谢谢.

Does anyone know how I can change the Resharper settings in such a manner that my desired behavior is realized? Thank you.

请注意,选项卡确实在默认的VS Intellisense中执行所需的行为.

Note that tab does perform the desired behavior in the default VS Intellisense.

在这种情况下,应执行以下操作:

In this particular case, here's what you should do:

  • 转到 ReSharper>选项>环境> IntelliSense> IntelliSense行为,然后将完成后自动插入括号设置为仅打开. li>
  • 现在,将插入号恰好位于SomeMethod()之前,键入Math.Ab,并用 Enter 完整地填写Abs,这与Rob H的正确建议相同.您将得到
  • 最后,按 Ctrl + Shift + Enter 调用完整语句,在这种情况下,将在语句末尾插入所需的括号,然后将插入号放在下一行.
  • Go to ReSharper > Options > Environment > IntelliSense > IntelliSense Behavior, and set Automatically insert parentheses after completion to Opening only.
  • Now, with the caret right before SomeMethod(), type in Math.Ab, and complete Abs with Enter, as correctly suggested by Rob H. You'll end up with Math.Abs(SomeMethod();
  • Finally, press Ctrl+Shift+Enter to invoke the Complete Statement, which in this case will insert the required parenthesis at the end of the statement, and put the caret on the next line.

请记住,尽管您可能还有很多其他的代码完成用法可能与这种设置更改发生冲突,但这可能不是最佳解决方案.

Keep in mind though that this might not be the optimal solution provided that you probably have plenty of other usages of code completion that could conflict with this kind of settings change.

如果需要在多个地方进行类似的代码修改,则应创建

If that kind of similar code modification is required in multiple places, you should possibly create a search and replace pattern instead.