how do you turn off auto complete adding a private in front of my variable?

so i type float blah and when i press enter it adds private in front, how do i turn that off?

 

8 comments
Comment actions Permalink
Official comment

Hello.

 

Sorry for the delay in responding.

Please try changing "Settings | Editor | Code Style | C# | Code Style | Modifiers | Prefer explicit/implicit private modifier for type members" to "Implicit" value.

Thank you.

Comment actions Permalink

Angelina Elycheva

I'm sorry to point out the details, but the following setting is correct.

"Settings | Editor | Code Style | C# | Syntax Style | Modifiers | Prefer explicit/implicit private modifier for type members" to "Implict" value.

0
Comment actions Permalink

Hello murapong,

 

thank you for being attentive to details.

I've updated my post with the correct option name.

Thank you.

0
Comment actions Permalink

I can't seem to get this to work at all.

Setting the preference to implicit and severity to warning yet it still inserts private and doesn't even warn about it. 

0
Comment actions Permalink

If I dial it up to an error, I get errors when the modifier is missing regardless of setting implicit or explicit. I never get errors, hints or warnings about the modifier being present, only when it's missing. 

0
Comment actions Permalink

Thecoffeeboy, could you please clarify what Rider version are you using? I can't reproduce it on the latest Rider 22.1 EAP.

0
Comment actions Permalink

I have the same issue as the OP. The suggested fix doesn't actually fix what the OP asked for. With the fix, Rider now automatically removes the private keyword. This isn't the desired behaviour. It is instead for Rider to STOP automatically adding or removing this keyword. That's what I want and I think also what the OP wants. Is there any way to do this?

Thanks! :)

0
Comment actions Permalink

Hello Quintin,

Thanks for the explanation :) 

However, at the moment, there is no way to exclude only modifier from the auto-formatting by ";". The only way I can advise, though, is to disable auto-formatting on semicolon completely in Preferences > Editor > General > Typing Assistance page of JetBrains Rider settings > Auto-format on semicolon. But that is kind of using a sledge-hammer to crack a nut. :)
I suppose it is a good idea for the feature request then! While there are a few methods to introduce feature requests, I think your best choice here would be to use our tracker here and submit a request. 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.

I hope, my reply was helpful :)
If any other questions remain - please let me know! 

0

Please sign in to leave a comment.