It's strange, but I cannot make it work.
I did this:
cargo install ast-grep
Then I'm searching in my code with: $ sg --pattern 'catch (...) { $$$ARGS }' --lang c++
./Server/TCPHandler.cpp
657│ catch (...)
658│ {
659│ state.io.onException();
660│ exception = std::make_unique<DB::Exception>(ErrorCodes::UNKNOWN_EXCEPTION, "Unknown exception");
661│ }
But there should be more than one result.It also does not work in Playground: https://ast-grep.github.io/playground.html#eyJtb2RlIjoiUGF0Y...