analyzer-codefix

Implement Roslyn analyzers, code fixes, and refactorings with testing patterns.

20.6k|4.3k|Updated Jan 11, 2015
One-click install
npx skills add https://github.com/dotnet/roslyn --skill analyzer-codefix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: analyzer-codefix
Source: https://github.com/dotnet/roslyn/tree/main/.github/skills/analyzer-codefix
Command: npx skills add https://github.com/dotnet/roslyn --skill analyzer-codefix

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Solves the problem of implementing Roslyn IDE analyzers, code fixes, and refactorings.

Core Features & Use Cases

  • Inherits from Roslyn's analyzer patterns to implement IDE diagnostics, fixes, and refactorings
  • Provides guidance for testing analyzers and fixes, including test base classes and verification patterns
  • Covers localization, resource strings, editorconfig integration, and documentation patterns

Quick Start

Create a new analyzer project and follow the Roslyn patterns to implement an analyzer, its corresponding code fix, and tests.

Frequently Asked Questions about analyzer-codefix

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement a Roslyn analyzer and code fix provider?

To implement a Roslyn analyzer and code fix, inherit from Roslyn's analyzer patterns to create diagnostic analyzers, wire up corresponding code fix providers, and assign unique diagnostic IDs for IDE integration.

What is the best way to structure tests for Roslyn analyzers and refactorings?

Testing Roslyn analyzers requires using dedicated test base classes and verification patterns to validate IDE diagnostics, code fixes, and refactoring outputs against expected source code changes.

How do I add localization and resource strings to a Roslyn analyzer project?

Adding localization to a Roslyn analyzer project involves creating resource strings and updating localization files to ensure diagnostics and code fix messages are properly displayed across different cultures.

Can I integrate editorconfig settings with my Roslyn analyzer diagnostics?

Yes, Roslyn analyzer projects support editorconfig integration, allowing you to configure analyzer severity and behavior based on project-specific editor configuration files.

What patterns should I follow when creating a Roslyn refactoring provider?

Creating a Roslyn refactoring provider involves implementing specific refactoring patterns that inherit from Roslyn's base classes to generate code actions and modify syntax trees within the IDE.

Does this guidance cover wiring diagnostic IDs to code fix providers?

Yes, the guidance explicitly satisfies requirements for wiring diagnostic IDs to their corresponding code fix providers, ensuring that IDE diagnostics correctly link to actionable code fixes.