Skip to content

λ1012 code fix: Fix-All needs a second pass when three or more fixes add the same using #1020

Closed

Description

@FreeApophis

Same defect as #1009, in a rule that shipped in Funcky.Analyzers 2.0.0: OrNone/PreferOrNoneCodeFix.cs (λ1012, prefer …OrNone over …OrDefault with a null check) inserts using Funcky.Extensions; through its own path with the default BatchFixer. Three or more diagnostics in one document that all need the using collide in the batch fixer, so some invocations are only rewritten by a second Fix-All pass.

Fix: derive from the ExtensionMemberCodeFix base introduced by PR #1013 (document-based Fix-All provider, rewrites all flagged invocations in one pass, adds the using once), and extend the λ1012 tests to three or more diagnostics per document. Found during the review of #1013.

Activity

  1. added a commit that references this issue on Oct 29, 2026
    c6573a2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions