Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-dev] Building a reliable (external) indexer

Hi jdt-dev,

to speedup several searches we do, I’m currently investigating how these could benefit from auxiliary indexes. This auxiliary indexes, however, need to be recent and I’m not exactly sure how to build such indexes reliably in Eclipse. I’d be glad to get your advice on how to do that correctly.

I assume that registering an IElementChangeListener via org.eclipse.jdt.core.JavaCore.addElementChangedListener(IElementChangedListener) would notify my of ALL relevant changes that happen while Eclipse is running (as soon as my bundle is up and registered a listener). Is that generally true - and the preferred way when building indexes?


There are some case, however, I’m not sure how JDT deals with these. For instance, how does the JavaModel deal with changes that happen outside the workspace or in between two Eclipse runs?

For example:
* If a project get’s removed between two runs of Eclipse, will the JavaModel always figure out that this project is gone and fire an „project deleted“ event?
* Same for library/class files/source files additions/removals that occur between runs?
* Is there any way to get notified when a jar/source/class file was replaced outside (with the same name but different content)?

Finally,
what is an appropriate way to register the ElementChangeListener so that I’m guaranteed to NOT MISS any ElementChangedEvent? The only reliable mechanism I could think of is to create a bundle that starts early (e.g. via IStartup), registers a BundleListener and waits for jdt.core to get activated. This, however, looks overly complicated. Is there any better solution that does not force JDT to be started early and allows me to register properly for all events?

Thanks,
Marcel






Back to the top