import type { Diagnostic } from "./diagnostic.ts"; export interface AppliedMechanicalFix { readonly code: string; readonly title: string; /** * GA-I1: where the *diagnostic* was reported, for naming a location — not * where its rewrite begins. * * A fix may edit text away from its report: VEL3008 deletes an import * statement to answer a name used further down, and VEL5042 rewrites the * `velar/look` import line to answer a token read nine lines later. Reporting * the first edit made `velar fix` print a position `velar check` had never * printed — `src/app.vel:2:1` for a diagnostic reported at `9:15` — so the * two commands named different places for one finding. They name the same * one now; the edits stay where the diagnostic put them. */ readonly offset: number; } export interface MechanicalFixResult { readonly text: string; readonly applied: readonly AppliedMechanicalFix[]; /** Fixes withheld because another fix in the same pass already rewrote overlapping text. */ readonly deferred: number; } /** * D38 §48: applies every mechanical rewrite a compile reported. Each edit is a * spelling change the diagnostic itself named, so the result is the source the * author meant to write — nothing here decides anything the diagnostic left * open. * * Two fixes that touch the same text cannot both be applied against one * snapshot, so the later one is deferred to the next pass rather than applied * blind. `velar fix` recompiles until no pass applies anything, which is also * what makes the command idempotent: a second run finds no fixes to apply. */ export declare function applyMechanicalFixes(text: string, diagnostics: readonly Diagnostic[]): MechanicalFixResult; //# sourceMappingURL=mechanical-fix.d.ts.map