Caret placement after code completion

Answered

I love Rider's syntax configuration options.  I've set it up to match my style so that a function call looks like this, with a space buffer:

print( "Hello world." );

When I start to type 'print' and complete the line with a tab, it places the caret right where the asterisk is located:

print( * );

That's great.  But when I type 'print(' Rider completes the rest like so:

print(*  );

The double space after the caret means I have to hit the right arrow-key to move my cursor, interrupting my normal typing flow.  Can I configure Rider to automatically place the caret in the center of the spaces?  If not, is that a feature that could be added please?

10 comments
Comment actions Permalink
Unfortunately, I can't reproduce this. Could you please attach your settings and tell me, what type of project/file (which language) do you use? Thanks!
0
Comment actions Permalink

Thanks for replying, Alexandra!  I've attached my settings.  Here's a video I recorded showing the issue with captured keystrokes, as well.

I'm using C# / Unity.

Settings

Video

0
Comment actions Permalink
Unfortunately, I still can't reproduce this :( Could you please remind, what version of Rider do you use?
0
Comment actions Permalink

It's Rider 2019.1.3 on Mac OS 10.14.5.

0
Comment actions Permalink
Hi, Try to disable `File | Settings | Editor | Code Style | C# | Spaces | Within other Parentheses | Method call parentheses`. It should help.
0
Comment actions Permalink

Unchecking that box does eliminate the spaces within a method call.  I'd like to keep the extra spaces but have the caret always placed between them when a method is autocompleted.  If that's not possible, which now seems likely, I'll just tell Rider not to autoformat this aspect of my code and insert the spaces myself.

0
Comment actions Permalink
In fact, I can't reproduce this in Rider EAP: https://www.jetbrains.com/rider/eap/. Could you please try it?
0
Comment actions Permalink

Sure.  The problem is the same for me in the latest EAP.  Here's a video of me trying it and also the EAP exported settings:

Video

Settings

0
Comment actions Permalink
Thank you, I was able to reproduce this also in EAP. I've created an [issue]( https://youtrack.jetbrains.com/issue/RIDER-31198) for this, please feel free to follow and vote to be notified about any changes. Have a good day!
0
Comment actions Permalink

Thanks for sticking with me, Alexandra!

0

Please sign in to leave a comment.