What problem does it solve?
This Skill provides comprehensive guidance for developers who need to create their own Roslyn analyzers, code fix providers, and code refactoring providers to enforce custom coding standards or identify specific code patterns within C# projects.
Core Features & Use Cases
- Analyzer Authoring: Learn to implement
DiagnosticAnalyzer for detecting code issues.
- Code Fixes & Refactorings: Implement
CodeFixProvider and CodeRefactoringProvider for automated code corrections and transformations.
- Multi-Version Targeting: Support multiple Roslyn versions for broader compatibility.
- Testing Strategies: Utilize
Microsoft.CodeAnalysis.Testing for robust unit tests.
- Use Case: A team wants to enforce a specific naming convention for asynchronous methods. They can create a custom Roslyn analyzer using this Skill to automatically flag violations and provide a code fix to rename the methods correctly.
Quick Start
Create a new C# project targeting netstandard2.0 and add the necessary Roslyn SDK NuGet packages to begin authoring your analyzer.