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.
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?
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!
> However, at the moment, there is no way to exclude only modifier from the auto-formatting by ";".
I got the same issue: I want this annoying function to be off completely. It should not remove nor add anything. Just NOT DOING THINGS!
When I want to type “private int” it should be “private int”, not “int”. When I type “int”, it should be “int”, not “private int”.
I don't have much quarrel with many of the other formatting things. In fact, I enjoy many of the indentation helpings.. But I guess, I have to turn off the feature completely then. :(
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.
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.
Hello murapong,
thank you for being attentive to details.
I've updated my post with the correct option name.
Thank you.
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.
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.
Thecoffeeboy, could you please clarify what Rider version are you using? I can't reproduce it on the latest Rider 22.1 EAP.
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! :)
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!
> However, at the moment, there is no way to exclude only modifier from the auto-formatting by ";".
I got the same issue: I want this annoying function to be off completely. It should not remove nor add anything. Just NOT DOING THINGS!
When I want to type “private int” it should be “private int”, not “int”. When I type “int”, it should be “int”, not “private int”.
I don't have much quarrel with many of the other formatting things. In fact, I enjoy many of the indentation helpings.. But I guess, I have to turn off the feature completely then. :(