Have some default C# code styles changed in Rider 2021?
In the middle of Rider 2021, I suspect that the following two C# "default" code styles have changed.
- Within single-line expression braces (unchecked to checked)
- After type cast parentheses (checked to unchecked)
The behavior in each version seems to be as follows.
- Before 2021.1: Old
- 2021.2: New
- 2021.3: New (old when Rider is newly installed)
- 2022.1 EAP: New (new even if newly installed)
I'm sorry if the details are different.
I would like to ask about the development team's views on this and future plans.
Will such changes occur in the future too?
Please sign in to leave a comment.
I have done the following:
What do you mean by old when Rider is newly installed?
Hello Anna Morozyk,
Thank you for your reply.
I re-tried to install Rider 2021.3.3 using JetBrains Toolbox, after uninstalling all versions and cleaning caches and files.
I also disabled Settings Sync and removed settings from cloud.
I got the result:
In this situation, the content of ~/Library/Application Support/JetBrains/Rider2021.3/resharper-host/GlobalSettingsStorage.DotSettings is as follows. (I use macOS 12.0.1)
This shows the two code styles(SPACE_AFTER_TYPECAST_PARENTHESES and SPACE_WITHIN_SINGLE_LINE_ARRAY_INITIALIZER_BRACES) are overwritten by the auto-generated settings.
And then, if I reset the settings layer This Computer by Manage Layers, the two overwriting settings are removed, and the resulting settings are:
So, the default behavior of these two settings is just ambiguous.
And this overwriting behavior does not exist in Rider 2022.1 EAP7...
I have verified this behaviour with developers and I am ready to bring you more details on this matter:
Usually, such styling settings are not changed with versions, however, this time we had a request to change them according to the Visual Studio default ones: RSRP-479702.
So getting back to the initial questions:
> I would like to ask about the development team's views on this and future plans.
There are no future plans on changing these settings
> Will such changes occur in the future too?
Until there is a solid reason for it (like matching default code styles) there is a quite low chance of changing these parameters.
However, you may ensure, that your set up will remain intact by using Layer Settings, which modify file ~/Library/Application Support/JetBrains/Rider2021.3/resharper-host/GlobalSettingsStorage.DotSettings , mentioned above, or Editorconfig, that will store your formatting style.
I hope, I could make it clearer for you!
Thank you for the clear answer!
I'm glad to know the details.
Our team will adopt the "new" code styles :)