Rider wrongly reports and applies that an editorconfig is overriding line feed settings

Hi everyone,

I can't stop Rider from removing newlines at the end of my files. It looks like it thinks the .editorconfig has “line feed at end of file” set to false, but that is not the case.

This is in Rider for C# with Unity.

The image shows that for “Line feed at end of file”, I checked it but EditorConfig is supposed to override it with False. I attached my EditorConfig, I can't see where that's supposed to come from. It is under the Upload id: 2026_05_07_28tFSQiKBKbETuC2XJRRoq (file: .editorconfig)

Also, the “Edit” link in the code style options that is supposed to let me edit the editorconfig does not work. It just reloads the same view.

There is another .editorconfig in "Library\PackageCache\com.unity.ide.rider@e4950c6d131b\.editorconfig", I have no idea where that comes from, but it looks like this.

root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf

[*.cs]
dotnet_analyzer_diagnostic.severity = none # https://github.com/JetBrains/resharper-unity/issues/2481

Please help me fix this.
0
9 comments

I additionally noticed that blank lines at the end of the file are

  • ignored for json files,
  • removed in C# files when the file is a class in a namespace and so the last closing brace is the closing brace of a namespace,
  • added in C# files when the file does not contain a namespace (e.g. MonoBehaviour classes created from Unity).

This is especially weird since I explicitly have resharper_blank_lines_after_file_scoped_namespace_directive = 1 and resharper_blank_lines_around_namespace = 1 in .editorconfig.

0

Hello WildRikku ,

Thank you for reaching Rider Forum.

As for the EditorConfig settings leading nowhere, I could reproduce the issue and filed a bug report in our tracker: 

RIDER-138890 Settings | Editor | Code Style | C# > EditorConfig > Edit just reloads the settings page

Please upvote it to subscribe to the updates. 

As for the final line being removed from the C# files, in your .editorconfig I have found the following option: 

resharper_csharp_insert_final_newline = false
Hence, this setting in the configuration file is responsible for removing the last newline character at the end of each file. 

Could you please try tweaking that value to true and let me know if that helped? 

0

Thank you Anna Morozyuk for your help.

I will follow the bug report in Youtrack.

I could confirm that setting resharper_csharp_insert_final_newline = true fixed the newline issue. I must have overlooked that, I am sorry for the trouble. I noticed that Rider required a restart after changing the editorconfig before it was applied, is that expected?

0

WildRikku ,

No, it should be applied on the spot. 

Could you please let me know if it is a one-time issue or a recurring one? 

0

Hey Anna Morozyuk ,

I checked and it is reproducible one-way:

  1. After the restart with editorconfig resharper_csharp_insert_final_newline = true, everything works as expected.
  2. Change to false and go to a tab with a C# file.
  3. Change is applied immediately: Trailing newlines are removed where they exist.
  4. Change back to true and go to a tab with a C# file.
  5. Nothing changes: Trailing newlines are still removed where they exist. No trailing newlines are added.
  6. Restart Rider.
  7. Everything works as expected: Trailing newlines are added where they are missing and left alone where they exist. You can now reproducibly start from 1.
0

Hey WildRikku ,

Could you please reproduce the issue and collect logs from Help > Collect Logs and Diagnostic Data and then share them to https://uploads.jetbrains.com. Send the ID of the upload right after. 

Looking forward to hearing from you soon.

0

Here you go Anna Morozyuk : Upload id: 2026_05_15_sZQbSZxreoENySsYvRwr2t (file: rider-logs-20260515-18573110406441911020397230.zip)

Weirdly, this time, I changed the setting in question to false and it was not applied immediately. That's odd since I reproduced the above one-way behaviour three times in the same project. However, I collected the logs with Rider in a state of mismatching behaviour and .editorconfig, so I hope it helps.

0

Hello WildRikku ,

Thank you for providing additional information. 

I was not able to determine the cause of this issue. Hence, I have filed a bug report in our tracker with the ID RIDER-139030 .editorconfig changes are not picked up on the fly — Rider restart required to apply. Please upvote it to receive updates. 

0

Thanks Anna Morozyuk , I appreciate your support! I have upvoted the issue.

0

Please sign in to leave a comment.