fastcodejava
fastcodejava

Reputation: 41097

How would you access Eclipse JDT index?

How do I access the index that eclipse uses to do Java search, import, etc?

Upvotes: 1

Views: 4521

Answers (1)

VonC
VonC

Reputation: 1324228

This old thread (for eclipse2!) mentioned:

In the meantime if you feel like indexes are not complete (open type doesn't show you a type which it should), you can workaround by:

  • exiting Eclipse,
  • find the index files in the metadata, and discard them all.
  • Restart Eclipse,
  • and activate the open-type dialog which will trigger proper reindexing.

Index files are located in:
<workspace>/.metadata/.plugins/org.eclipse.jdt.core/, you want to get rid of all '*.index' files in the doubt + 'savedIndexNames.txt'.

I just checked with my current Eclipse Helios 3.6.1, and those files are still around.


More generally (and programmatically), the SearchParticipant API is involved with those files, ans mentioned in bug 308402

SearchParticipant has the method #selectIndexes and part of its documentation says "An index location represents a path in the file system to a file that holds index information." and to that effect we store our .index files in our own location and return those when the #selectIndexes method is called using the BasicSearchEngine.

You can see an example here.

Upvotes: 5

Related Questions