Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tab behavior Resharper Intellisense Options

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

enter image description here

but the line currently is

enter image description here

As you expect I start typing:

enter image description here

and after a tab I get this

enter image description here

but I wanted it to become

enter image description here

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

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

like image 400
JBSnorro Avatar asked Jan 17 '12 17:01

JBSnorro


People also ask

How do I change my ReSharper settings?

To configure the main set of ReSharper preferencesIn the Visual Studio menu, choose ReSharper | Options. In the Options dialog that appears, select a node in the left pane and configure settings in the right pane. Use the search box in the left top corner to find a specific preference.

How do you toggle IntelliSense?

You can easily turn Intellisense on and off And it says, hey Ctrl + Q followed by Ctrl + I will toggle Intellisense on and off.

Why is my IntelliSense not working?

If IntelliSense is not working as it should on your Windows 11/10 PC, you can try restarting VS Code and this should solve the issue. Restarting the program can be really effective and time saving in some cases. If the issue persists, you can try restarting your computer altogether.


1 Answers

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

  • 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.

like image 81
Jura Gorohovsky Avatar answered Oct 15 '22 01:10

Jura Gorohovsky