Search code examples
intellij-idea

How can I tell IntelliJ's "Find in Files" to ignore generated files?


I need to do a find in files. I want to ignore or exclude generated files, like JAX-WS artifacts or classes in target folders. How can I tell IDEA to exclude these files from the find?


Solution

  • Update Version 2024.3

    The Find in Files feature has been enhanced with a new search scope, Project Files Excluding Git-Ignored. This option excludes any files ignored in .gitignore files from your search results, helping you focus only on the relevant code when searching through your project.

    screenshot of find in files with scope set to Project Files Excluding Git-Ignored

    This will automatically take care of filtering out generated files, assuming they've been added to your gitignore.