Every time I use Search In Path in Android Studio, I end up with generated code being returned as the first section of results.
Search In Path
I usually search for so
For me, just to add to the answer, the scope !file:*intermediates*/&&!file:*generated*/&&!file:*build*/&&!lib:*..* worked even better!
!file:*intermediates*/&&!file:*generated*/&&!file:*build*/&&!lib:*..*