Tabs turning into spaces in Rider
I've searched through all of the settings in Rider to try to use tabs instead of spaces, but it still seems to persist - if I do a tab, or if one is added on pressing enter, then I have to press delete twice to get rid of it instead of just once (i.e. a tab is being made as 2 spaces) … It's driving me crazy, anyone know how to make it just use tabs? Thanks!
Edit: I should have mentioned, this is for C#, and I've tried Code Style → C# → indent style : Tab
Please sign in to leave a comment.
The easiest way to detect the code style settings and the differences with the current code file is on the bottom status bar of Rider.
Ensure you have changed the configurations correctly.
Thanks so much! I didn't see that down there. Clicking it showed that it was auto-detecting indent settings from the file.
It took me a while to then find the tick box in Settings → Code style, to turn off “Detect and use existing file indents for editing”. Then closed and reopened rider, and it was fixed.
However it STILL made 2 spaces instead of a tab, if I press return on a line that itself has 2 spaces at the start of it, i.e. on return it just matches whatever is on the current line, even if it's set to do tabs instead of spaces for when you press tab... So to fix that, I had to go through every file in the project and do Edit → Convert indents → To tabs. Now all is well.
You don't have to apply the actions on each file. Set up the Code Style rules, then use Code | Reformat Code, it will apply the current settings automatically. Using Code | Reformat Code and Cleanup, you can apply the code style rules on the solution level.
Thanks again, that works really nicely :)
I'm starting to really like Rider now! At first the number of settings is overwhelming, but once you get it set up how you want, it's perfect.
I'm using it with Unity and the integration is great. The only small problem I have left is that the unity integration is somehow putting small icons into the code (a little unity icon next to certain variables, or an image of the color next to a color initialization, etc), and I can't find the setting to completely turn those off, because I don't know what they're called.
Not sure if you are referring to any features mentioned in this documentation.
If you are referring to the Code Vision feature for Unity projects, you can adjust the visibility of them in File | Settings | Editor | Code Vision.