Skip to content

0.4.0

Choose a tag to compare

@dannote dannote released this 20 Apr 12:51
· 27 commits to master since this release

Added

  • Syntax-aware diffExAST.diff/3, ExAST.diff_files/3, ExAST.apply_diff/1
    • GumTree-inspired AST matching: functions by name/arity, nodes by kind/label/signature
    • Edit classification: :insert, :delete, :update, :move
    • Function reorder detection reported as :move edits
    • Child suppression: child edits covered by a parent are rolled up
    • Inline line-level diffs within updated nodes (Myers algorithm)
    • Patch application: ExAST.apply_diff/1 produces patched source from a diff result
  • mix ex_ast.diff CLI task
    • Colored output with -/+ markers (red/green, auto-detected)
    • --no-color, --no-moves, --summary, --json flags
    • Human-readable labels (def create/1 instead of {:def, :create, 1})
  • AST and zipper inputPatcher.find_all/3 and Patcher.replace_all/4 now accept source strings, Sourceror.Zipper, or raw AST
  • Quoted expressions as patterns — patterns and replacements can be strings or quote blocks:
    Patcher.find_all(source, quote(do: IO.inspect(_)))
    Patcher.replace_all(ast, quote(do: IO.inspect(expr)), quote(do: dbg(expr)))