Releases: elixir-vibe/ex_ast
Releases · elixir-vibe/ex_ast
v0.12.0
Added
- JSON output for
mix ex_ast.search,mix ex_ast.replace, andmix ex_ast.diffvia--format json/--json, backed byJason.Encoderprotocol implementations for ExAST result structs. %ExAST.CompiledPattern{}metadata for compiled patterns, including candidate signatures, structural terms, and broad/multi-node flags.ExAST.Pattern.compile_ast/1for callers that need the normalized pattern AST.ExAST.rewrite_plan/4andExAST.Rewriterfor inspecting replacement plans before applying patches, with overlapping-replacement conflict detection.- File-level parallelism for unbounded
ExAST.search/3andsearch_many/3, configurable with:concurrency. - Conservative source-text prefiltering using index terms to avoid parsing files that cannot match a pattern.
ExAST.Comments.associated/3for retrieving comments related to a source range (:before,:after,:inside,:inline, or aggregate:comment).- Import-aware call matching for imported functions such as
import Ecto.Query, only: [from: 2]matchingEcto.Query.from(_, _). - Reach, ExSlop, and ExDNA-backed static analysis hardening in CI via an isolated
tools/reach_runnerproject.
Changed
ExAST.Pattern.compile/1now returns%ExAST.CompiledPattern{}instead of a raw normalized AST. UseExAST.Pattern.compile_ast/1for the old AST shape.ExAST.search/3results now include the matched:range.ExAST.replace/4now plans rewrites before applying them and supportsformat: true; the CLI exposes this as--format-output.- Syntax-aware diffing now treats same-body function renames as function updates rather than delete+insert pairs.
mix cinow includes explicit ExSlop smell analysis and Reach smell/dead-code checks in addition to existing compile, format, Credo, Dialyzer, tests, and ExDNA checks.
v0.11.2
v0.11.1
Added
piped()selector predicate — matches only when the selected node is a pipe expression (|>). Since ExAST normalizes pipes during matching, there was previously no way to distinguish piped from direct call forms. Usewhere(piped())to match only piped calls, orwhere(not piped())for direct calls only.
v0.11.0
Added
ExAST.Index.plan/1,ExAST.Index.terms/1, and structural index plan
structs for building external candidate indexes while keeping ExAST as the
semantic verifier.ExAST.Index.Terms.from_source/1,from_ast/1,from_pattern/1, and term
signal classification helpers.ExAST.Selector.requires_source?/1,requires_comments?/1,find_all/3,
andmatch?/3for source-aware selector planning and verification.ExAST.Comments.extract/1andExAST.Comments.text/1for comment extraction
with source position metadata.ExAST.Symbols.definitions/1andExAST.Symbols.references/1for syntactic
definition/reference extraction.- Symbol helpers for stable qualified names and optional BEAM-native MFA tuples:
ExAST.Symbols.qualified_name/1,mfa/1, andmatches?/2. - Indexing and code intelligence guide.
v0.10.1
v0.10.0
Added
ExAST.Patcher.find_many/3for running multiple named AST pattern checks in a single traversal where possible, returning matches tagged with:pattern.ExAST.search_many/3for searching files with multiple named patterns while preservingsearch/3options such as:limit.
Changed
- Optimized repeated single-node pattern matching by compiling patterns once, normalizing candidate nodes once per traversal, and using conservative call signature prefilters for common local, remote, piped, and nested call patterns.
v0.9.1
v0.9.0
Added
-
Capture guards —
where/2now accepts^pinsyntax to filter on captured values, similar to Ecto's parameter references. Supportsmatch?/2for structural checks, plain comparisons, multi-capture expressions, and composition with existing structural predicates. -
Source text in match results —
Patcher.find_all/3now includes a:sourcefield with the matched source snippet. -
Module attribute pattern matching — attribute names are now captureable:
@name Application.get_env(_, _)
v0.8.1
v0.8.0
Added
- Comment predicates for source-aware queries:
comment/1,comment_before/1,comment_after/1,comment_inside/1, andcomment_inline/1. - Comment matchers accept strings, regexes, and explicit text matchers like
prefix/2,suffix/2, andtext/2. - CLI comment filters detect
/.../and~r/.../regex syntax.
Hex: https://hex.pm/packages/ex_ast/0.8.0
Docs: https://hexdocs.pm/ex_ast/0.8.0