Pluggable lookup table mapping issue codes to fix strategies. Plays the role of eslint's rule registry / IntelliJ's LocalQuickFixProvider registry: callers register strategies once and every subsequent applyFixes run dispatches through the same registry.

The SDK ships a pre-populated singleton at DEFAULT_FIX_REGISTRY. Plugins typically register additional strategies into that singleton on import — every call to applyFixes then sees them automatically. Tests, custom pipelines, or code that needs to work in isolation can build a fresh FixRegistry and pass it to applyFixes directly.

A Fix declares the codes it handles in Fix.codes. When register is called the strategy is stored under each of those codes. Last registration wins — a later registration for an existing code overrides the earlier one. This matches plugin-framework convention: bring your own override later in the load order.

Use FixRegistry.unregister to remove all registrations for a code, or FixRegistry.clear to start over.

Constructors

Methods

  • Iterator over every code that has a registered strategy. Useful for building a "what can we auto-fix?" summary alongside an inspection report.

    Returns IterableIterator<string>

  • Iterator over every distinct Fix registered. One strategy can claim multiple codes (fix.codes[]), so this deduplicates — each strategy appears once regardless of how many codes it owns. Useful for UI code that wants to render one entry per strategy (e.g. an "Inspection settings" panel with one row per fix).

    Returns IterableIterator<Fix>

  • Get the stored override bag for a fix, or undefined when no overrides are set. Returned object is a snapshot — callers should not mutate it; use setConfig to change stored overrides.

    Parameters

    • target: string | Fix

    Returns Record<string, unknown>

  • Hydrate stored overrides from a serializeConfigs blob. Each code's bag is merged with any existing entry (last-write-wins on overlapping keys), so a partial blob overlays cleanly without wiping per-fix fields the caller didn't touch. Codes the caller didn't supply keep their current overrides; orphan codes (no matching registered fix) are accepted — they sit idle until that fix is registered.

    Parameters

    • blob: Record<string, Record<string, unknown>>

    Returns void

  • Snapshot every stored override bag as a JSON-safe object, keyed by primary code. Suitable for persistence — call loadConfigs with the same blob to restore.

    Returns Record<string, Record<string, unknown>>

  • Set (or merge) the override bag for a fix. Pass the fix itself or its primary code. Subsequent applyFixes calls layer this bag under any per-call overrides — per-call overrides win on the keys they declare.

    Merges with any existing entry rather than replacing. Pass an empty bag plus a follow-up clearConfig to wipe.

    Parameters

    • target: string | Fix
    • overrides: Record<string, unknown>

    Returns void

  • Remove the strategy registered under code. Returns true if one was present, false otherwise.

    If the strategy that owned code also handled other codes, those other codes remain pointed at it — only the named code is detached.

    Parameters

    • code: string

    Returns boolean