How to make Rider 2019.1.1 to NOT format whitespace in all file?

Completed

Hi,

I am using JetBrains Rider 2019.1.1 in MacOS with C#, and every time I alter a source file, git detects a lot of whitespace changes in ALL file that I did not do that are very annoying.

The files are from a repository, and I do not know in which IDE were written (VS 2017 probably), but I do not want to reformat the file's whitespaces. I just want to modify the parts I am interested at. 

How can I tell Rider to stop messing with the whitespaces ?

I do not want to ignore whitespace changes as GitHub diff can do, I want Rider to stop making such changes.

1
7 comments

The same problem in HTML. How to stop delete whitespaces automatically? I want to commit changes ONLY for lines I modify. 

1

Hi! 

Please try to set 'File | Settings | Editor | General | Strip trailing spaces on Save' to None and on File | Settings | Editor | Code Style | C# | Spaces tab change the Preserve Existing Formatting > Extra spaces insidesetting to Leave all extra spaces and tabs. 

Is that are you looking for? 

0

I do not have "Settings" but "Settings for New Solutions" in the "File" menu.

I went to "JetBrains Rider" menu, and click on "Preferences" (which went to the same place) and changed that setting, but Rider keeps messing all the whitespaces.

0

I just realised it is messing with the line breaks, probably because the files originated in a windows system. However I cannot find an option to stop Rider from changing them.

0

Any update on this issue?

I'm having the same problem with C++.

It looks like only the C# language has the full control over the whitespace preservation settings.

Note that it's considered bad coding practice to do unrelated formatting changes all over the file while you're modifying only certain lines in the file (i.e. mixing formatting and logic changes, creating problems with code merges,...). This should never be the default behaviour.

0

Is there a chance that you have "Remove trailing spaces on" configured under Preferences | Editor | General (On save) section?

0

Could you please update Rider to the latest 2019.2.2 version? 

You can also try to in the `Commit Changes` window the `Ignore whitespaces (and empty lines)` setting.  

Could you please attach some examples (files or screenshots) illustrating the problem? 

 

-1

Please sign in to leave a comment.