This is why codepathfinder.dev is born. It underhood use tree-sitter to search functions, class, member variables and pulls code accurately instead of regex.
I started using it like tool call in Security scanning (think of something like claude-code for security scanning)
Give it a read if you're interested:
https://codepathfinder.dev/blog/codeql-oss-alternative/
https://codepathfinder.dev/blog/introducing-secureflow-cli-t...
Happy to discuss!