Files
oh-my-pi/crates/pi-ast
can1357 bb35e79189 fix(ast): auto-wrap multi-node patterns instead of erroring
A pattern like `"@types/bun": $V` parses to multiple root AST nodes and was
rejected with "Multiple AST nodes are detected". When no explicit selector is
given, retry the fragment wrapped in a minimal single-node context (JSON: `{ <frag> }`
selecting `pair`), quoting bare metavars so JSON parses. Falls back to the
original error if the wrapped form still fails, so bad patterns are unchanged.
Applies to both ast_edit (compile_pattern) and ast_grep (compile_search_patterns).
2026-07-12 13:40:43 +02:00
..