tags:

views:

3140

answers:

2

Hi,

I'd like to exclude certain folders (and all their subfolders) from searching within Eclipse, is this possible?

Thanks, Don

+12  A: 

The quick and dirty way:

Right click on a folder, go to properties, and mark a folder as derived. Derived entities are excluded from searching by default.

The safe way:

Create a working set including only those entities you want searched and search only within that working set. See Dave Ray's answer for details on this procedure.

Instantsoup
Like Dave noted in his answer: setting things that are not really derived to be derived might cause problems. Like when using Maven to create a distribution.
Arjan
+6  A: 

I could imagine that marking resources derived might cause problems in other areas. Instead, create a working set with the folders you want to include in the search:

  • Open Search dialog (ctrl+h)
  • Change search scope to Working Set
  • Click Choose ...
  • Click New to create a new Working Set with the what you want searched (or Add All and then remove the ones you want filtered
Dave Ray
i wonder what to do if there's sh*tloads of files I want excluded, like all the .svn entries and what not. I simply don't want the search to yield results from the SVN metadata when searching for stuff in `*.*` There doesn't seem to be a friendly way of telling the working set to exclude these files.
Peter Perháč