Rider: reformat C# comments, space after double slashes

I've enabled the setting Editor > Code Style > C# > Space after ‘//’ in comments.

My code deliberately contains a comment line without a space after ‘//’. I mark the line (selection), and choose Context Actions: Reformat and cleanup… > Detect code style settings.

This gives me: “Looks like your code conforms to current settings”.
Why isn't the missing space detected? I cannot reformat to the desired format as well…

0
3 comments

Hello Andreas,

Thank you for contacting Rider support.

I see that the “Detect code style settings” action indeed doesn't report the violation of the “Space after ‘//’ in comments” rule. I registered this issue to our tracker: RSRP-501689 Detect Code Style action doesn't respect the "Space after '//' in comments".

Meantime the Reformatting itself does work fine for this rule for me. Does it work for you if you follow these steps?

  • Open sample file where space is missing after ‘//’ (or remove some space character somewhere in a file);
  • Select Code | Reformat and Cleanup | File {filename.cs}; 

Have a nice day!

0

Hi Dmitry, I can successfully reformat the file with the method you discribe.

0
I am glad to know it works as expected. That way you can run reformat on the desired scope. Next, please watch the issue for further updates.

Have a nice day! 
0

Please sign in to leave a comment.