Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
415 views
in Technique[技术] by (71.8m points)

java - How would you access Eclipse JDT index?

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...