If I want to call a function/method in C++ my normal way is to type the first letters of the name and investigate the IntelliSense suggestions. If I choose one, the name will be inserted, but it would be great if also the parenthesis could be inserted. Of course the caret should be placed in the middle of the new parenthesis. I am using Visual Studio 2015 and ReSharper. Is there a setting in VS or R# about this?
eg
std::string s;
s.em
the result after the use of IntelliSense should be
std::string s;
s.empty(_CARET_);
I don't think that having the cursor between parentheses for empty
function makes sense since empty
one has no parameters. But at the same time, having the cursor between parentheses for any function which has parameters is definitely handy. So, ReSharper C++ provides exactly this:
in case a function has no parameters
s.e
;empty
from the completion popup; s.empty()_cursor_
and you can continue typing whatever you like after closing parenthesis.in case a function has parameters (e.g. append
)
s.a
;append
from the completion popup; s.append(_cursor_)
and you can specify parameters.Well, as you may see, ReSharper C++ locates the cursor depending on a function's signature.
In VS2017 you can do the following to achieve the desired result:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With