跳到正文
FunCoding

deprecate-analyzer-or-refactoring

官方

Use when obsoleting or retiring RCS####, RR####, or RCF#### in roslynator, replacing an analyzer with another id, or when tempted to use IsObsolete on an Analyzer entry — analyzers use Status Obsolete, not IsObsolete.

Star
3,505
最近提交
2026年11月1日

.claude/skills/deprecate-analyzer-or-refactoring/SKILL.md

在 GitHub 上查看

Deprecate Analyzer or Refactoring

Overview

Deprecation mechanism differs by artifact type. Wrong choice causes compile errors.

When to Use

  • Superseding an analyzer with another (ObsoleteMessage naming successor)
  • Retiring a rule with no replacement (Status=Disabled for analyzers)
  • Marking refactoring or compiler fix obsolete (IsObsolete="true")

Not for: opt-in analyzers (IsEnabledByDefault=false is not deprecation).

Quick Reference

ArtifactMechanism
Analyzer (default)<Status>Obsolete</Status> + <ObsoleteMessage>
Analyzer (retire)<Status>Disabled</Status> — burns id
Refactoring / RCFIsObsolete="true" on XML element

Full detail: references/mechanisms.md.

Implementation

  1. Update XML (mechanism per artifact — references/mechanisms.md)
  2. cd tools && pwsh ./generate_code.ps1
  3. Remove implementation, registration, and *Tests.cs
  4. Keep the obsolete XML entry — analyzers (Status=Obsolete), refactorings/RCF (IsObsolete="true"). Delete the whole <Analyzer> block only when retiring with Status=Disabled
  5. dotnet build + format verify
  6. CHANGELOG.md under ### Changed

Common Mistakes

MistakeFix
IsObsolete="true" on <Analyzer>Use <Status>Obsolete</Status> + <ObsoleteMessage> — compile error otherwise
Delete entire <Analyzer> block when supersedingKeep obsolete entry; remove implementation/tests only
Status=Disabled with a successorUse Obsolete + ObsoleteMessage
Confuse with IsEnabledByDefault=falseOpt-in is not deprecation
Skip codegen after XML changeDescriptors/options pages stay stale

相似的 Skill

rea-analysis-optimization

MOmorluto/rea486k近 7 天新增 8,943 个 star

精选

diagnosing-bugs

诊断困难 bug 和性能回归,用测试或脚本构建反馈循环定位问题。

MAmattpocock/skills337k近 7 天新增 4,978 个 star

setup-ts-deep-modules

MAmattpocock/skills337k近 7 天新增 4,978 个 star

code-review

MAmattpocock/skills337k近 7 天新增 4,978 个 star

tdd

MAmattpocock/skills337k近 7 天新增 4,978 个 star

retro

MAmattpocock/skills337k近 7 天新增 4,978 个 star