AST Structural Search
ast_searchIdentify code patterns by matching abstract syntax trees, not raw text. Use $VAR for single nodes and $$$ for sequences; ignores comments and strings.
Instructions
Tree-sitter AST structural search via ast-grep. Matches real syntax trees, not text — so patterns can never match inside strings or comments. Use $VAR for one node, $$$ for many. Example: 'try { $$$ } catch ($E) { }'
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lang | No | ts | |
| path | Yes | Absolute path to the repository root | |
| pattern | Yes | ast-grep pattern, e.g. 'useEffect($$$)' or '$X as any' |