Scenario
When working on a codebase, one might have specific styles and conventions that are already in place. The "Detect Code Style Settings" feature helps quickly align with these conventions without having to manually go through each code style setting.
Question
How to automatically configure code style based on a code snippet using Rider or ReSharper?
Answer
- Format line(s) of code manually the way you want them formatted
- Select manually formatted code
- In ReSharper, use ReSharper | Edit | Detect Code Style Settings. In Rider, press Alt+Enter → Reformat and cleanup → Detect code style settings
- ReSharper or Rider will show the code style settings it has inferred from your code.
- If necessary, further customize the code style settings manually after they've been detected.
- Save the adjusted settings to your preferred layer
Comments
0 comments
Please sign in to leave a comment.