Our main “perform_probe” function remains largely the same. Below we show how you might
incorporate “search_with_structured_patterns” to handle the AST logic in a specialized path.
For simplicity, we won’t fully replace the existing logic. Instead, we’ll demonstrate
how you’d do it if you wanted to leverage the new approach.
Helper function to search files using structured patterns from a QueryPlan.
This function uses a RegexSet approach for deterministic pattern matching
and collects matches by term indices. It uses the file_list_cache to get a filtered
list of files respecting ignore patterns.