开发者

Resharper reformat is changing line endings

开发者 https://www.devze.com 2023-03-28 05:51 出处:网络
Is there a setting to change it so ReSharper leaves my line endings alone? Nothing is jumping out at m开发者_开发技巧e.

Is there a setting to change it so ReSharper leaves my line endings alone? Nothing is jumping out at m开发者_开发技巧e.

Explanation of how I verified it below...

It looks like when I use ReSharper and do a complete code cleanup, it will change my line endings to CRLF, regardless of what they were before.

I've proven this to myself by having a file open in VS2010, doing File -> Advanced Save Options and changing line style to Unix (LF)

In Notepad++ I turn on viewing line endings and see only LF at the end of the lines.

Then, I do a ReSharper code cleanup, and CRLF shows up everywhere.


Under Resharper / Options / Code Editing / General Formatter Style / Default Line Ending Style you can select - Current OS | Windows | Mac | Unix


Resharper reformat is changing line endings

Do not forget to also ensure your git settings are accurate for line endings. If you're like me, you ended up here because you keep your source code on a Mac and run Visual Studio within windows. You need to ensure your git settings also include the right "core.autocrlf" setting.

https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration


CRLF line ending is hard-coded in ReSharper since version 1.0.

The main reason for this - VS running under Windows, where CRLF ending is standard. Your project must have been very special to not use Windows defaults for text files

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号