To preface, I'm not a developer, and I had a MacBook Pro previously for many years which did not do this, which is why I'm looking for a solution.
Currently, whenever I search anything in Finder, I am overloaded with thousands of files (.h, .str, .xml, res, .py, .css - and the list goes on) which make searching for anything completely redundant because I'm now trying to locate what I searched for in a sea of completely irrelevant files.
I'm not sure when or how my Finder started showing these files, but it wasn't when I bought it. I also had a MacBook Pro 2013 and 2019 before the M2 that didn't do this, so clearly something I installed or changed made this happen.
I'm not going to delete these files, obviously, but I need some way to stop this happening or remove them from search, the current detriment to my workflow is huge.
They aren't hidden files either, just to clarify. Many of these are coming from the Applications folder and within the program files of multiple programs, but not all of them. I've tried hiding Developer files from Spotlight with a spoofed Xcode app which didn't work.