Why is Reformat and Cleanup not reformatting the code?
Completed
Reformatting and Cleanup (ctrl-alt-F) is not reformatting the code. While Reformat Code (ctrl-alt-L) actually does the reformatting but only at the file level.
How does one reformat the code at the folder level? Also, it's not clear what's the difference between the two options I mentioned.
In R# there's one option for code reformatting (ctrl-alt-F) where one selects the profile AND it does the work.
Not sure why it's split into two different options in Rider which makes it confusing. Is ctrl-alt-F in Rider just for selecting the profile?
Please sign in to leave a comment.
Hello Abdu,
`Reformat and Cleanup` does reformat the code according to the selected profile. Once you selected the desired profile, you are free to call the separate action `Silent Reformat and Cleanup` (Ctrl+Alt+Shift+F). It allows you to avoid the profile selection dialog by using the previously selected one. You can find more details here.
`Reformat code` allows to reformat the only opened file. It might be useful in the case of huge solutions, as instead of scanning the whole solution every time `Reformat` is called, the only open file is being reformated.
You might find the recently added feature interesting. You can enable the `Reformat on save` feature from `File | Settings | Tools | Actions on Save`.
I want to reformat code for all the files in a folder and its subfolders.
I right click on the top folder and select Reformat and Cleanup and select a profile, hit OK. Nothing happens. I tried all the profiles.I open a file and it's not reformatted. I hit ctrl-alt-L and select Include Subdirectories. The file is still not reformatted.
I hit ctrl-alt-shift-F on the folder and the file is still not reformatted.
The only way I can reformat the file is to open the file and hit ctrl-alt-L inside it. I don't want to do this for every single file.
How do I reformat all the files in a single action?
Apologies for the late reply.
There was an issue, please try updating Rider or try a workaround
There was an issue when the reformatting behavior was broken in some circumstances. It was fixed with Rider 2021.3 EAP7. What version of Rider do you use? (`Help | About`)
If the build number of Rider is less than 213.5605.83, there are two options:
If the above instruction does not help
Would you mind trying to execute the following actions:
Please send the generated archive to us via the Upload Service and let me know the Upload ID.
I will be waiting for your response.
It seems to be working now. Thanks.
I am happy I was able to help you.
If you have any questions or difficulties in the future, do not hesitate to contact support.
Have a great day!