Fallout-build/Fallout

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

Closed

#242 opened on May 28, 2026

 (0 comments) (0 reactions) (0 assignees)C# (13 forks)github user discovery
good first issuetarget/2027

Repository metrics

Stars
 (111 stars)
PR merge metrics
 (Avg merge 2d 15h) (63 merged PRs in 30d)

Description

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

Contributor guide