Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse - Ignore Entire Directories

Tags:

eclipse

aptana

I use Aptana Studio (based on Eclipse). I'm trying to get Eclipse to completely ignore an entire directory inside a project. I mean COMPLETELY. I don't want it to display in the project folder. I don't want Eclipse to even be aware it exists.

Unfortunately, all my efforts to add it as a filter don't work. See http://forums.aptana.com/viewtopic.php?f=14&t=8340#p33714 . I think the filter only prevents the folder from being displayed in the project display. It doesn't keep Eclipse from actually looking at all the files in that folder for code assist, etc.

My problem is that directory has thousands of text files. So, each time Eclipse opens or refreshes this project, it analyzes all those files.

How can I prevent this?

like image 309
Justin Noel Avatar asked Jun 09 '09 07:06

Justin Noel


People also ask

How do I exclude files in eclipse?

Window -> Open Perspective -> Other... -> Java(default) Navigate to the file/folder you want to exclude. Right Click -> Resource -> Exclude from build.

How do I search a specific 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.

How do I delete a folder in eclipse?

Eclipse considers everything in the workspace folders to be part of the workspace. Deleting or moving to a location outside of the workspace is the only way to remove something completely from the workspace.


3 Answers

Not sure about this aptana thing, but there is a convenient way to do it in native eclipse:

  1. Right-click a project folder in Project Explorer tree and go to "Properties".
  2. Resource -> Resource Filters.
  3. Add as much exclusion filters for files/folders as you like.

If your project tree is not refreshed immediately, press F5 to enforce it.

like image 54
Gleb Varenov Avatar answered Oct 30 '22 20:10

Gleb Varenov


Consider also the 'Derived' checkbox: right-click an entry in the package explorer, choose properties, check Derived. This may solve part of your problem.

See http://robmayhew.com/eclipse-ignore-folder/

like image 21
James Clark Avatar answered Oct 30 '22 20:10

James Clark


If you have a linked resource (pointing off to some other file/folder on disk) with the same name in the same location in the resource tree, then the real folder on disk will be hidden from the resource model.

Unfortunately you can't create the linked resource if the real directory is already there in the project structure. You can try something like this:

  1. On disk, rename/move the directory in question
  2. Refresh the project, the directory is gone
  3. Create a linked resource ( New -> File/Folder >> Advanced -> Link to file in the file system ). Name it the same as the original directory.
  4. On disk, restore the original name of the directory
  5. Refresh project.
like image 24
Andrew Niefer Avatar answered Oct 30 '22 20:10

Andrew Niefer