Ferrous API Reference

All Types / Ferrous.Pedantic

class PedanticCodeFixProvider

public sealed class PedanticCodeFixProvider : CodeFixProvider

Roslyn code fix provider for Ferrous.Pedantic diagnostics: FE0400: Scaffold missing enum switch expression arms. FE0401: Replace .Unwrap()/.Expect(...) with .UnwrapOr(default). FE0403: Convert capturing ScopeGuard.Defer(() => ...) to zero-allocation ScopeGuard.Defer(state, static s => ...).

Constants

public const string ExhaustiveSwitchEquivalenceKey = "Ferrous.ScaffoldSwitchArms"

Equivalence key for scaffolding missing switch arms.

public const string ReplaceUnwrapEquivalenceKey = "Ferrous.ReplaceUnwrapWithUnwrapOr"

Equivalence key for replacing Unwrap/Expect with UnwrapOr.

public const string StatefulDeferEquivalenceKey = "Ferrous.ConvertToStatefulDefer"

Equivalence key for converting capturing ScopeGuard.Defer to stateful static lambda.

public const string DiscardUnawaitedTaskEquivalenceKey = "Ferrous.DiscardUnawaitedTask"

Equivalence key for discarding an unawaited Task/ValueTask.

public const string ReplaceThrowingBclEquivalenceKey = "Ferrous.ReplaceThrowingBclCall"

Equivalence key for replacing a throwing BCL call with a Try/OrDefault variant.

public const string AddUsingDeclarationEquivalenceKey = "Ferrous.AddUsingDeclaration"

Equivalence key for converting a leaked disposable local declaration to 'using var'.

Properties

public override ImmutableArray<string> FixableDiagnosticIds

Methods

public override FixAllProvider GetFixAllProvider()
public override async Task RegisterCodeFixesAsync(CodeFixContext context)