Skip to main content

AstMatcherFn

Type Alias AstMatcherFn 

Source
pub type AstMatcherFn = dyn Fn(&str, &str) -> bool + Send + Sync;
Expand description

Function signature for the underlying pattern matcher. Given an ast-grep pattern and the file content, return true if the pattern matches at least one node in the content.

The default implementation shells out to the sg (ast-grep) CLI — same approach as crate::tools::ast_grep. Tests inject a pure-Rust matcher so they don’t require sg to be installed.