ast-grep

last updated: May 23, 2024

https://github.com/ast-grep/ast-grep
https://ast-grep.github.io/

Find Code by Syntax

ast-grep is a code tool for structural search and replace. It is like syntax-aware grep/sed! You can write code patterns to locate and modify code, based on AST, in thousands of files, interactively.

they give this example: sg -p '$A && $A()' -r '$A?.()'

see also: ripgrep, fastmod

↑ up