ast_search
Find code by structure, not text: match syntax-aware patterns with metavariables to locate every call site shaped like a given example, returning file, line, and matched text.
Instructions
Structural code search via ast-grep: match a syntax-aware pattern (metavariables like $X, $$$ARGS) instead of text. Use for 'every call site shaped like this' questions a text grep gets wrong. Returns file/line/matched text.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lang | Yes | language id: php, python, bash, javascript, typescript, ... | |
| repo | Yes | absolute path to the repo to search | |
| paths | No | restrict to these paths (default repo root) | |
| pattern | Yes | ast-grep pattern, e.g. foo($$$ARGS) |