Към всички skills

add-compiler-diagnostic-fix

dotnet · Тестване

Use when adding a Roslynator code fix for C# compiler error CS#### or RCF####, editing Diagnostics.xml or CodeFixes.xml, or when compiler-diagnostic-fixes-testing.md shows XunitCompilerDiagnosticFixVerifier or bare DiagnosticId like "CS0106" — in-repo uses AbstractCSharpCompilerDiagnosticFixVerifier and CompilerDiagnosticIdentifiers. Contributor how-to exists but testing page targets NuGet consumers.

Оригинален текст · няма потвърден превод на български

Теми: csharp · dotnet · roslyn · visual-studio

Първо прочетете инструкцията.

Файлът се зарежда от посочения източник само по ваше действие. Можете да го прочетете тук, да го копирате или да го запазите като .md.

Оригинален SKILL.md
GitHub хранилище
Звезди на репото
3481
Лиценз
NOASSERTION
Последна проверка на записа
22.09.2026 г.

Добавете в своя инструмент.

Командата отваря избора на skills от репозитория. Прочетете файла и условията на автора преди изпълнение.

npx skills add dotnet/roslynator

Страницата копира текст. Не инсталира и не изпълнява нищо на устройството ви.

Откъс от SKILL.md

Началото на файла на автора, без превод.

Add Compiler Diagnostic Fix

Overview

Compiler fixes use Diagnostics.xml + CodeFixes.xml → codegen → CompilerDiagnosticCodeFixProvider → test. Contributor how-to: how-to-add-compiler-diagnostic-fix. Do not follow compiler-diagnostic-fixes-testing alone — it targets NuGet consumers.

When to Use

  • New fix for CS#### compiler diagnostic
  • New RCF#### entry linking one or more CS ids
  • Extending fix coverage for an existing compiler error

Not for: Roslynator analyzers (add-analyzer), refactorings (add-refactoring).

Gate: approved GitHub issue (CONTRIBUTING.md).

Read references/implementation.md before writing tests.

Confirm metadata parameters (hard gate)

STOP. Do NOT edit Diagnostics.xml / CodeFixes.xml, run codegen, or implement until the user has confirmed every required parameter below. Do not invent titles or identifiers when the user (or issue) did not state them.

Use AskQuestion when available; otherwise ask conversationally. Batch related choices.

ParameterRequired?Notes
Compiler CS#### id(s)yesOne RCF may fix multiple CS ids
New Diagnostics.xml entry?if CS not already catalogedConfirm Title / Message / HelpUrl (usually from Microsoft docs)
RCF IdproposeCompute next free RCF#### from CodeFixes.xml, or extend an existing RCF when appropriate; do not ask unless ambiguous
IdentifieryesPascalCase for the code fix
TitleyesCode-fix menu / docs title
Code action titleyesString passed to CodeAction.Create (may match or differ from XML Title)

When proposing RCF Id, state the chosen value in your plan/summary (e.g. “using next free RCF0121”). Skip asking other parameters only when the approved issue or the user's message already states the value explicitly.

Quick Reference

StepLocation
Diagnostic catalogsrc/Diagnostics.xml
Fix metadatasrc/CodeFixes.xml
Codegencd tools && pwsh ./generate_code.ps1
Providersrc/CodeFixes/CSharp/CodeFixes/
Testssrc/Tests/CodeFixes.Tests/CS####IdentifierTests.cs
ChangelogCHANGELOG.md

Implementation

Целият SKILL.md в GitHub