Optional: Roslyn codefix to auto-rename IHaz* references on CS0618
#242 opened on May 28, 2026
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.Analyzersthat:- 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
- Listens for CS0618 diagnostics whose target type is one of the 9
- 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