ast-grep-find is a powerful structural search tool that understands the underlying syntax of your code rather than just treating it as raw text. By leveraging Abstract Syntax Tree (AST) patterns, it allows developers to find complex code structures like specific function signatures, class definitions, or import patterns while ignoring comments and strings. It supports advanced refactoring capabilities through precise pattern replacement and multi-language support, making it an essential utility for large-scale codebase maintenance and automated refactoring tasks.
主要功能
01501 GitHub stars
02Dry-run mode to preview refactoring changes safely
03Precise refactoring and pattern replacement across multiple files
04Advanced wildcard matching for variables, expressions, and arguments
05Syntax-aware structural code search using AST patterns
06Support for major languages including Python, JavaScript, TypeScript, and Go
使用场景
01Standardizing code patterns across different directories and modules
02Automating large-scale codebase refactoring and variable renaming
03Finding specific function call patterns while ignoring comments and strings