Ferrous.CodeFixes 3.0.0

dotnet add package Ferrous.CodeFixes --version 3.0.0
                    
NuGet\Install-Package Ferrous.CodeFixes -Version 3.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Ferrous.CodeFixes" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ferrous.CodeFixes" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Ferrous.CodeFixes" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Ferrous.CodeFixes --version 3.0.0
                    
#r "nuget: Ferrous.CodeFixes, 3.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Ferrous.CodeFixes@3.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Ferrous.CodeFixes&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Ferrous.CodeFixes&version=3.0.0
                    
Install as a Cake Tool

Ferrous.CodeFixes

Roslyn IDE CodeFixProviders and CodeRefactoringProviders for the Ferrous analyzer suite:

Diagnostic Quick-Fixes (Ctrl+.)

  • FE0001 (MustUseCodeFixProvider): Inserts an explicit _ = ... discard for ignored [MustUse] values.
  • FE0301 / FE0302 (TypestateCodeFixProvider): Adds [ConsumesSelf] to typestate transition methods and captures discarded transition results in var next = ....
  • FE0400 (PedanticCodeFixProvider): Scaffolds missing enum, [Closed]/closed, and [DiscriminatedUnion] arms/cases in both switch expressions and switch statements.
  • FE0401 (PedanticCodeFixProvider): Replaces .Unwrap()/.Expect(...) with .UnwrapOr(default), .Match(...), or early-return ?-style error propagation inside Result-returning methods.
  • FE0403 (PedanticCodeFixProvider): Converts capturing ScopeGuard.Defer(() => ...) to zero-allocation ScopeGuard.Defer(state, static s => ...).
  • FE0405 (ExtendedSafetyCodeFixProvider): Generates a private System.Threading.Lock _lock = new(); field and swaps the lock target.
  • FE0406 (ExtendedSafetyCodeFixProvider): Replaces null-forgiving expr! with Option.FromNullable(expr) or an explicit ArgumentNullException guard.
  • FE0407 (SafetyCodeFixProvider): Changes async void return type to async Task.
  • FE0408 (PedanticCodeFixProvider): Explicitly discards an unawaited Task/ValueTask with _ = ... or adds await (converting the method to async Task if needed).
  • FE0409 (SafetyCodeFixProvider): Replaces blocking sync-over-async .Result/.Wait()/.GetAwaiter().GetResult() with await.
  • FE0410 (PedanticCodeFixProvider): Replaces throwing LINQ calls (First/Single/Last/ElementAt) with *OrDefault().
  • FE0411 (ExtendedSafetyCodeFixProvider): Adds throw; inside swallowed empty catch blocks.
  • FE0412 (ExtendedSafetyCodeFixProvider): Adds the readonly modifier to non-mutating struct members causing defensive copies.
  • FE0414 / FE0415 (SafetyCodeFixProvider): Wraps unchecked arithmetic or lossy numeric casts in checked(...).
  • FE0416 (ExtendedSafetyCodeFixProvider): Replaces exact floating-point ==/!= with epsilon tolerance comparisons.
  • FE0417 (SafetyCodeFixProvider): Inserts a // SAFETY: ... justification comment stub above unsafe blocks.
  • FE0419 (PedanticCodeFixProvider): Converts leaked disposable locals to using var.
  • FE0420 (SafetyCodeFixProvider): Rewrites unchecked indexing col[i] to safe col.Get(i).
  • FE0425 (ClippyAndConcurrencyCodeFixProvider): Removes needless .ToList()/.ToArray() materializations and rewrites .Count() > 0 to .Any().
  • FE0427 (ClippyAndConcurrencyCodeFixProvider): Rewrites if (x.IsOk / IsSome / IsErr) + .Unwrap()/.UnwrapErr() to TryGetOk / TryGetValue / TryGetErr.
  • FE0428 (ExtendedSafetyCodeFixProvider): Rewrites mutable collection properties (List<T>, Dictionary<K,V>, HashSet<T>, T[]) on record/[Immutable] types to ImmutableArray<T> / ImmutableDictionary<K,V> / ImmutableHashSet<T>.
  • FE0501 (SafetyCodeFixProvider): Wraps mutable static fields in Mutex<T>.
  • FE0503 (ClippyAndConcurrencyCodeFixProvider): Rewrites detached Task.Run(...) inside a TaskScope to <scope>.Spawn(...).

IDE Refactorings

  • FerrousMigrationRefactoringProvider: Converts throwing methods → Result<T, string>, nullable-returning methods (T?) → Option<T>, and primitive parameters → [Newtype(typeof(T))] structs.
  • FerrousStructuralMigrationRefactoringProvider: Converts abstract record hierarchies → [DiscriminatedUnion] and lock (_gate) + field → Mutex<T>.

Installation

dotnet add package Ferrous.CodeFixes

Or install everything at once via the Ferrous metapackage:

dotnet add package Ferrous

See ferrous.westness.cc and the Wiki for full documentation.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Ferrous.CodeFixes:

Package Downloads
Ferrous

Rust-grade compile-time safety, zero-allocation primitives, source generators, and Clippy-style Roslyn analyzers for .NET (polyfilling on .NET 10 and lighting up natively on .NET 11 / C# 15).

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0 0 11/30/2026
2.8.1 0 11/30/2026
2.8.0 0 11/30/2026
2.7.0 0 11/30/2026
2.6.0 0 11/30/2026
2.4.2 0 11/30/2026
2.4.1 0 11/30/2026
2.4.0 0 11/30/2026
2.3.0 0 11/30/2026
2.2.0 0 11/30/2026
2.1.0 0 11/30/2026
2.0.0 0 11/30/2026
1.7.4 0 11/30/2026
1.7.3 0 11/30/2026
1.7.2 0 11/30/2026
1.7.1 0 11/30/2026
1.7.0 0 11/30/2026
1.6.0 0 11/30/2026
1.5.0 0 11/30/2026
Loading failed