ripgrep is brilliant and I use it a lot but it has no knowledge of the languages it works with so I don't use it for searching anything more than names of functions or stuff.
If you really need to search for code constructs that can span multiple lines (but not always do) then Treesitter-aware tools like ast-grep and gritql are superior.
If you really need to search for code constructs that can span multiple lines (but not always do) then Treesitter-aware tools like ast-grep and gritql are superior.