resharperrider

Share code style settings between Rider and ReSharper


Is there an easy way to export/share my Rider code style settings and use those in ReSharper (VS) and vice versa?


Solution

  • You have three ways of doing it:

    1. Manual export/import. In Rider: File > Settings > Manage Layers > This Computer > right-click > Export to file > select CodeStyle, CodeInspection and maybe other settings your need. In ReSharper: Extensions > ReSharper > Manage Options > This computer > right-click > Import from file.
      That would work provided that you never saved your settings to solution layers, but given your question, I think that's unlikely.
    2. Shared solution settings. They would allow you to bind your code style setting to your solution and commit them to VCS like Git, and would work across all Rider/ReSharper installations, even for your team mates who open that solution. But if you create another solution, then you have to resort again to manual sync between them. In Rider: File > Settings > Manage Layers > This Computer > right-click > Copy settings to > solution ... team-shared. Then if you want to change shared settings, don't forget to use down arrow near Save button and select "Solution ... team-shared" (would be easier in next versions, I promise :) ).
    3. .editorconfig file. It would allow you to share your code style settings not only between Rider/ReSharper, but also partially for plain Visual Studio/Visual Studio Code installations for all solutions that are placed under a folder in the file system where you place your .editorconfig. Of course, you can also commit it to VCS. But you can't put there non-code-style settings (like typing assists, code completion, etc). In Rider: File > Settings > Code Style > click Export button near "Enable EditorConfig support". Then if you want to change your code style settings, click Help > Find action (usually mapped to Ctrl-Shift-A) and type "Edit .editorconfig" (again, would be easier in next versions, I promise).