Cannot disable auto-insert pair brackets

Answered

When using auto complete for a function name a parentheses pair after the function is always added.  I find this rather annoying since there's no way to continue typing past the function call without using the right cursor key to step over the closing parentheses.

Is there a way to disable this behaviour?

There is an option under Typing Assistance labelled "Auto-insert pair brackets, parentheses and quotes", but disabling this doesn't change the behaviour.

 

 

 

 

 

 

18 comments
Comment actions Permalink

I'm giving Rider a serious try now that PackageReference support is in for legacy project files, and this behavior is driving me nuts. Has anyone found a way to disable it?

0
Comment actions Permalink

I've always hated auto braces in VS and resharper both. It's one of the first things I turn off when setting up a new machine. I emailed support about this and so far have not heard anything back. I find it weird you can disable them in resharper but not in rider.

0
Comment actions Permalink

Hi there,

Starting from Rider 2018.2 it's possible to configure this behavior in "File | Settings | Editor | General | Code Completion" -> "Automatically insert parentheses after completion". One can either choose to insert only opening bracket or do not insert them at all.

Thanks for your patience!



2
Comment actions Permalink

Unfortunately this option is not available in GoLand as of 2019.2

0
Comment actions Permalink

Hi! You can create a feature-request for GoLand team in YouTrack.

0
Comment actions Permalink

Doesn't Appear to work for

[Header(("....Attributes

which get an extra bracket. And if I attempt to

Mathf.Clamp01( 

around

expression1 + expression2;

It auto completes to 

Mathf.Clamp01( expression1 + expression2 );

When I was going for

Mathf.Clamp01( expression1 ) + expression2;

Is there any way to have it just add what I've selected in the drop down, and not add anything else or ever attempt to help me with typing, or ever try to format things as I'm writing, or ever assume I want more brackets or more tabs or help lining things up? Just the thing I've highlighted. That literal exact piece of text with no whitespace and no other changes?

I can't work with this micromanagement (I'd struggle even if it got things right), but I'll miss some nice Rider features otherwise :|


(Rider 2019.2.3, all options unchecked in Typing Assistance)

Thanks!
J

0
Comment actions Permalink

Hi Sicklebrick

Thank you for your feedback. 

Have you tried to disable completion in "File | Settings | Editor | General | Code Completion" -> "Automatically insert parentheses after completion" as mentioned above? 

0
Comment actions Permalink

Hi Alexandra,

On the upside, when it comes to inserting () for functions, and auto pairing them around the current line:
I took this screenie before replying to the thread and checking:



Literally just disabling everything, saving, then re-enabling the same settings fixed the second brackets issue (not even a restart), and it seems to be working after a restart.

However... Same settings (or literally just "Show suggestions as you type" being the only enabled option) is still randomly inserting () when I try to do something like [Header... leaving me with [Header((). 

Not sure what's going on, but it looks like you got one or two bugs on your hands.

Cheers,
J






0
Comment actions Permalink

Edit:
It's back to its old tricks.

float steer = ( signTime * steerInput );


Gets the treatment and comes out:

float steer = ( Mathf.Clamp01((signTime * steerInput) );

:(




0
Comment actions Permalink

Hi J, 

could you please check the following: 

- do you use any settings synchronization tools? 

- does it appear only in one solution or in any new one when you suspend all settings? 

- could you please try to clear caches with `File | Invalidate caches and restart`? 

Thank you in advance. 

0
Comment actions Permalink

No joy :|

- no sync tools

- happens on completely new projects

- tried invalidating the cache

The settings appear the same, but now it's
-inserting the braces
-ignoring my preferred formatting while it does it
-inserting semicolons at the end of return statements

How do I disable this?

0
Comment actions Permalink

Hello, 

sorry for the delay. 

Could you please create a new support request (Help | Contact support) and attache there your settings and logs right after the issue? 

Thank you in advance. 

0
Comment actions Permalink

I've filed a bug report as

A- enabling and re-disabling the option finally fixed it for Rider/C#
B- but [Attributes() still ignore this setting
C- pycharm has no such option despite people asking since like 2014!

https://youtrack.jetbrains.com/issue/RIDER-37554

0
Comment actions Permalink

Thank you! We'll process it. 

0
Comment actions Permalink

It would be great if we could have the option to disable the braces only when autocompleting new instances of class. In C#, one often uses curly braces and passes arguments that way. Like so:

new SomeClass
{
Foo = "bar"
}

I still want to have the regular braces added on function call autocompletion though...

0
Comment actions Permalink

Hi Jankalfus! 

Do you use live templates when creating a new class? In this case, you can change the template in `File | Settings | Editor | Live Templates | C#`. Find the "class" template and replace curl braces to regular. 

If you have another case, please, let me know. 

 

0
Comment actions Permalink

Hi Alexandra, I wasn't talking about creating new class, I was talking about creating an instance of a class. For example within a method:

public void doSomething() {
var something = new
SomeClass
{
Foo = "bar"
};
// ...
}
0
Comment actions Permalink

Hi! Sorry for the delay. 

Unfortunately, this is not possible now. You can use our tracker here and submit a request for this. On the tracker, others can see your request and add their vote if they find such a tool would be useful, which helps our team to better understand which features/tools our users are eager for. I believe this can help give the best visibility for your request.

0

Please sign in to leave a comment.