Syntax-aware diffing for Elixir source code.
Parses two source strings with Sourceror, maps structurally similar AST nodes, and produces a diff result with insert, delete, update, and move edits.
Summary
Functions
Applies a diff result to the left source, producing the patched output.
Types
@type option() :: {:include_moves, boolean()}
Functions
@spec apply(ExAST.Diff.Result.t()) :: String.t()
Applies a diff result to the left source, producing the patched output.
Updates and deletes are applied via range replacement. Inserts are placed at the resolved insertion point based on sibling/parent context. Move edits are skipped (content unchanged, only order differs).
@spec diff(String.t(), String.t(), [option()]) :: ExAST.Diff.Result.t()
@spec diff_files(String.t(), String.t(), [option()]) :: ExAST.Diff.Result.t()