Formatting Question C++
Answered
Hello,
I am trying to fix an issue where if I do the if macro it's fine it would like this:
if (true)
{
}
but if I just type it myself which is what I always do it looks like this
if(true)
{
}
while visual studio would correct this and add the space Rider never fixes that and I've looked everywhere in the formatting to try and fix it but nothing seems to help. Is this fixable?
Please sign in to leave a comment.
Hi,
Unfortunately, auto-formatting on the closing brace is not yet supported. We have a feature request in YouTrack: https://youtrack.jetbrains.com/issue/RSCPP-18671. You can vote or follow the ticket to get a notification when it is implemented.
If you're experiencing formatting issues with Rider and it's not automatically correcting spaces in your if statements as Visual Studio does, you might want to check and adjust the code formatting settings. Here's how you can do it:
Go to Settings:
Adjust Code Style Settings:
Modify Spaces in Control Statements:
Apply Changes:
If Rider is still not behaving as expected, there might be some specific settings that are conflicting or not configured correctly. You might need to explore the Rider documentation or forums for more advanced troubleshooting.
Additionally, make sure that Rider is recognizing the file as a C# file and that there are no conflicting plugins or external formatting tools affecting the behavior.