Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exclude folders from Eclipse search

Tags:

search

eclipse

Is there a way to exclude certain folders (and all their subfolders) from searching within Eclipse?

like image 775
Dónal Avatar asked Jan 14 '09 14:01

Dónal


People also ask

How to exclude folder in Eclipse?

There is a straight way to do it: Right-click a project folder in Project Explorer tree and go to "Properties". Resource -> Resource Filters. Add as many exclusion filters for files/folders as you like.

How do I exclude folders from search?

Select the Privacy & security category from the left side. Scroll down and click on the Searching Windows tab. On the Searching Windows page, click on the Add an excluded folder button and select the folder that you want to hide from Windows Search. This will add the selected folder to the list of excluded folders.

How do I search for a folder in Eclipse?

The Eclipse search dialog box allows you to search for files that contain a literal or a character pattern in the entire workspace, a set of projects, a specific project or folders selects in the package explorer view. Clicking on the Search menu and selecting Search or File or Java. Clicking Ctrl + H.


1 Answers

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 problem with this approach is that Eclipse "forgets" that the folder is derived if you delete it (either from within Eclipse or externally, followed by refreshing the project tree). Like so often with Eclipse, this is a long-standing bug (10 years in this case) which still applies to the current version (4.6 Neon at the time of writing).

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.

like image 124
Instantsoup Avatar answered Oct 12 '22 18:10

Instantsoup