5

I am using JetBrains Rider version 2018.3.3 on Ubuntu 18.04. I have enabled the setting Editor -> General -> Ensure line feed at file end on Save. This works great when saving a previously edited .NET/C# .cs file.

However, when applying the "Reformat code" action (keyboard shortcut: Ctrl+Alt+L) which also automatically saves the file after applying the code reformat, the line feed at the end of the file is removed again.

Is this something for a bug report or is there another setting to configure the reformat action to stop this behavior?

dvlcube
  • 1,117
  • 1
  • 12
  • 20
mxscho
  • 1,990
  • 2
  • 16
  • 27

1 Answers1

9

I found the required setting.

Checking Line feed at end of file in Settings -> Editor -> Code Style -> C# -> Line Breaks and Wrapping prevents code reformat/cleanup actions from removing the newline at the end of files.

enter image description here

mxscho
  • 1,990
  • 2
  • 16
  • 27