Auto-locate for callback-based patterns