Fallout-build/Fallout

Optional: Roslyn codefix to auto-rename IHaz* references on CS0618

已關閉

#242 建立於 2026年5月28日

 (0 則留言) (0 個反應) (0 位負責人)C# (16 個分叉)github user discovery
good first issuetarget/2027

倉庫指標

星標
 (125 顆星)
PR 合併指標
 (平均合併 2天 15小時) (30 天內合併 63 個 PR)

描述

Why

Follow-up to #120, which ships [Obsolete] IHaz* alias interfaces in Nuke.Components. With the aliases in place, the C# compiler already emits CS0618 at every legacy reference site, with an actionable message pointing at the renamed IHas* form. Consumers can fix manually one-by-one.

A Roslyn codefix attached to CS0618 (for these specific obsolete types) would close the loop — Visual Studio / VS Code light bulb offers a one-click rename. Pure convenience; not required for the migration to function.

Action

  • Add an analyzer/codefix to Fallout.Migrate.Analyzers that:
    • Listens for CS0618 diagnostics whose target type is one of the 9 Nuke.Components.IHaz* aliases
    • Offers a codefix to rewrite the identifier to the corresponding IHas* form
  • Cover all 9 aliases (mirror the table in #120)
  • Tests using the existing analyzer-test pattern (Verify snapshots)
  • Assign the next sequential FALLOUT00x diagnostic ID after the existing family

Why this is optional

The compiler already provides the warning. The codefix is a UX nicety, not a correctness requirement. If it never lands, consumers can:

  • Use VS / Rider's built-in "Rename" refactoring after manually changing one occurrence
  • Run a regex find-and-replace
  • Run fallout-migrate (if that CLI ends up covering this rename — separate scope)

Done when

  • Analyzer + codefix shipped in Fallout.Migrate.Analyzers
  • VS / Rider light bulb appears on IHaz* references with a one-click rename
  • Snapshot tests cover all 9 aliases

貢獻者指南