Empty-line auto formatting changes after EditorConfig is exported

So in trying to fix formatting issues within our team we decided I should create a rules file and share it with the team. As I understand it, this is done by exporting an EditorConfig file into the root of the code base. We can then share this file via git to other team members.

After I did this via the Export button (under File | Settings | Editor | Code Style) the Reformat Code command behaves differently. It now starts adding spaces to all empty lines to fit with the code around it. Not sure if I'm misunderstanding the usages of the EditorConfig or if this is a bug…

Using the following version

JetBrains Rider 2024.1
Build #RD-241.14494.307, built on April 8, 2024

I added an image below. 

1
8 comments

Hello,

 

Could you please share .editorconfig file with us? You can use our service for this purpose.

Thank you.

0

Hey

That I can!

Upload id: 2024_04_24_JqfsqaLT3MSnZajTRwGGPo (file: .editorconfig)

0

Any updates on this?

0

Hello,

 

Please accept my apologies for the delay in responding. It took some time to reproduce the issue.

Turns out that the specified behavior is caused by 

trim_trailing_whitespace = false

Could you please let me know if it's crucial to keep this setting in the file? Currently, we don't actually support this setting - Add .editorconfig trim_trailing_whitespace support.

You've mentioned that you exported the settings from Rider to .editorconfig. Possibly there's some issue with export. Could you please share your settings with us? For this please Manage Layers button in Settings window and export all layers 9right lick on each layer | Export to file). 

Thank you in advance.

0

I don't know what that behavior does specifically. 

The behavior I want is that empty lines in between functions do not add spaces/tabs to align with code. Basically it works as I like it until I export the setting file and use it to overwrite local settings…

I exported and uploaded all three layer files here:

Upload id: 2024_06_11_qvCxexsZM9HB2xyVjDwpzV (files: Computer.DotSettings and 2 more)

0

Hi,

Could you please update to Rider 2024.1.3 and check if the problem is still reproduced with the same .editorconfig file?

I've also created an issue concerning export problem - RIDER-113660

Thank you.

0

I updated to JetBrains Rider 2024.1.3 (Build #RD-241.17011.166, built on June 7, 2024) and can confirm that now when I export the .editorconfig file via File | Settings | Editor | Code Style it seems to be working as intended!

 

0

Thank you for letting me now.

Glad to know it works now :)

0

Please sign in to leave a comment.