Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 559
Mihail Shishkov Avatar asked Nov 30 '19 18:11

Mihail Shishkov


People also ask

How do you sync JetBrains rider settings?

Alternatively, select File | Manage IDE Settings | Sync Settings to JetBrains Account from the main menu. In the dialog that opens, click the Enable Settings Sync button. Your local settings will be exported to the JetBrains repository linked to your account.

How do I enable ReSharper in rider?

If you want Rider to use the same 'This computer' settings file as ReSharper, select Synchronize machine-wide Rider and ReSharper settings on the Tools | ReSharper page of JetBrains Rider settings Ctrl+Alt+S .

Does JetBrains rider include ReSharper?

It's cross-platform, familiar to millions of developers, and provides core functionality such as VCS and database support. On top of that, we add ReSharper features: navigation and search, refactoring, code inspections, quick-fixes, and so on.

Does rider support EditorConfig?

As of version 2022.2, JetBrains Rider supports most frequently used EditorConfig properties for the . NET coding conventions: csharp_indent_braces.


1 Answers

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).
like image 179
Dmitry Osinovskiy Avatar answered Oct 04 '22 21:10

Dmitry Osinovskiy