[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [cdt-dev] Mozilla now has built-in support for CDT project generation
|
Alena Laskavaia wrote:
>
> So ideally headless app would not allow indexer to kick in at all (because it is not needed for headless build/import)
We actually do this in our fork of the headless builder - we added a command line argument "-no-indexer" that disables the indexer. I guess we can contribute that if there is interest. Maybe there is no need for a command line argument at all and it can always be disabled.
I'm not sure how clean our code is, judging from the comments; it does not use IIndexManager.addIndexerSetupParticipant(...). I'm including it below in case anyone wants to take a look.
A quick bugzilla search also turned up this request for the same thing:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=355609#c4
-Christian
> if( disableIndexer ) {
> CCorePlugin.getIndexManager().setDefaultIndexerId(IPDOMManager.ID_NO_INDEXER);
> // yes, this is ugly - but I haven't found a way to "officially"
> // stop the indexer.
> // The problem is that the "workspace job" for the
> // "index manager" (PDOMIndexerJob) is created and scheduled
> // during plugin activation (CCorePlugin.start(BundleContext))
> // and therefore, it may already be running when we first reach
> // this line of code. Therefore, we do not just (temporarily)
> // disable the indexer but also stop it.
> if( CCorePlugin.getIndexManager() instanceof PDOMManager ) {
> PDOMManager man = (PDOMManager)CCorePlugin.getIndexManager();
> man.shutdown();
> }
> }