Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Set property indexAllFiles

Thanks Markus.

I there another way to specify which files/folders should be indexed, without needing to set KEY_INDEX_ALL_FILES to "true".

It seems that IIndexManager.update(new ICElement[] {project}) only works when the corresponding files contained in the project can be indexed regarding KEY_INDEX_...
Am I right?


Schorn, Markus wrote:
try to use IndexerPreferences.set(prj,
IndexerPreferences.KEY_INDEX_ALL_FILES, "true"),
the indexer should kick in automatically.
This is not an API, however for the purpose of testing it should be


-----Original Message-----
From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Nicolas Musset
Sent: Wednesday, July 22, 2009 3:34 PM
To: CDT General developers list.
Subject: [cdt-dev] Set property indexAllFiles
Importance: Low


In order to run a test, I need to set the property KEY_INDEX_ALL_FILES to true. I try doing so, but apparently it does not work since PDOM did not contains the expected entries:

    private boolean forceIndexAllFiles() throws CModelException {
        // get the preferences
IPreferencesService prefService = Platform.getPreferencesService();
        Preferences[] prefs = {new

String restore = prefService.get("indexAllFiles", "false", prefs);
        prefs[0].put("indexAllFiles", "true");

        return restore.equalsIgnoreCase("true");

And then, I force the indexer to index the project again:

        // Get the name of the project
        String projectName = fProject.getName();

        // Retrieve the CProject
        ICProject cproject = CCorePlugin.getDefault().getCoreModel()

        // If no CProject can be found, there is no need to continue

        IIndexManager indexManager = CCorePlugin.getIndexManager();
        if (indexManager.isProjectIndexed(cproject)) {

        if (!indexManager.isIndexerIdle() ||
indexManager.isIndexerSetupPostponed(cproject)) {
indexManager.joinIndexer(IIndexManager.FOREVER, new NullProgressMonitor());

I think that I may have to tell the Indexer that the property has changed, but I don't know how.

I'm running this test with CDT 4.0.

cdt-dev mailing list

cdt-dev mailing list

Back to the top