Example:
My C# intentation settings in VS is configured as tabs.
An .editorconfig file in my current solution overrides this to indent using 4 spaces.
The built-in VS command Edit -> Advanced -> Format Document respects the overridden settings from .editorconfig.
However, applying CodeRush Document Formatting feature (either as part of a Code Cleanup command or executed by itself) only seems to look at the VS-configured settings, and does not seem to take into account that they are being overridden by .editorconfig.
This leads to several problems:
- Formatting rules defined and enforced on a team are violated by CodeRush
- The built-in formatting and CodeRush formatting produce different results even on the same solution
Since the .editorconfig file is Visual Studio's built-in standard mechanism for overriding format settings per project, I expect CodeRush to honor those settings.
Hi Daniel,
Thank you for informing us about this issue.
I managed to reproduce your scenario.
This functionality implementation can be quite complex and take significant time. So I cannot promise you that we will prepare the solution soon.
We will notify you once changes are ready.
I am also looking forward to this, is this something you are actively looking to implement?
CodeRush have several nice features and it would be good to be able to use formatting and refactoring without manually having to update the style of the code afterwards.
Hi Pontus,
Thank you for your feedback. We realize that this functionality is useful. However, we cannot provide you with any time frames as to when we will provide support for .editorconfig.
Could you send us your .editorconfig file? Perhaps we can help you setup some CodeRush options according to your Visual Studio settings. Also, please clarify in which specific cases you face difficulties (specific refactoring, format document, code clean up, etc.).
I'm looking forward to your reply.
Hi Daniel and Pontus,
We have found a way to support .editorconfig file settings in the CodeRush formatting engine. We have implemented this functionality and it is included in the 19.2.9 build. This build is available for download in the Visual Studio Marketplace and Download Manager. Please check whether CodeRush formats code according to settings in your .editorconfig file.
We are looking forward to hearing from you.
That’s really great news! Is there any documentation on which .editorconfig settings CodeRush now respects, and which ones it does not?
Hi Daniel,
Now, CodeRush reads only those settings from the .editorconfig file that don't have counterparts in our formatting engine (namely the "Use Tabs or Spaces" and indent size options). In previous versions, CodeRush always read these settings from Visual Studio and did not consider the .editorconfig file.
Currently, our documentation doesn't contain this information. Thank you for pointing this out. We will update the documentation accordingly.