Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Updating the indexer does not discard the unused header files from the index

Refer to

I suppose you can try to call ICLanguageSetting.setSettingEntries with
empty array (I did not test it though). Something like this:

		ICProjectDescriptionManager mngr =
		ICProjectDescription des = mngr.getProjectDescription(project, true);
		ICConfigurationDescription confDes = des.getDefaultSettingConfiguration();

		// Configure include paths
		ICFolderDescription folderDescription =
confDes.getRootFolderDescription(); // or use
getResourceDescription(IResource), or pick one from
		ICLanguageSetting[] languageSettings =

		ICLanguageSettingEntry[] projectIncludes = new ICLanguageSettingEntry[](0) ;

		for(int idx = 0; idx < languageSettings.length; idx++)
			ICLanguageSetting lang = languageSettings[idx];
			lang.setSettingEntries(ICSettingEntry.INCLUDE_PATH, projectIncludes);

2008/11/14 Abeer Bagul <abeer4eclipse@xxxxxxxxx>:
> Hi All,
> In our IDE, we have multiple versions of a toolchain and the user switches
> between versions while developing his C project.
> When the user sets one version of the toolchain for the project, we update
> the Paths and Symbols properties page for the project with the path to the
> include directory where the header files of the toolchain version are
> stored.
> E.g.: Add the following path to the Includes tab in the Paths and Symbols
> properties page:
> C:\alltoolchains\version1\include
> When the index is rebuilt using the popup menu action Index -> Rebuild
> (class: RebuildIndexAction), all the header files in the above location
> which are included in the project are properly added into the indexer.
> Lets assume 6 header files from the toolchain include directory are added
> into the index.
> Now the user changes the toolchain version to use version2. When the user
> changes the version, we update the Includes tab in the Paths and Symbols
> properties page and now the earlier path is replaced with:
> C:\alltoolchains\version2\include
> We want to update the index rather than rebuilding it (to improve
> performance). So the action Index -> Update with Modified files (class:
> UpdateIndexWithModifiedFilesAction) is used. This action adds 6 header files
> from the new version (version2) into the index, but the older header files
> from version1 are not removed.
> Hence if the user selects a call to printf in the project source and presses
> F3, a dialog pops up asking him to select either
> C:\alltoolchains\version1\include\stdio.h
> or
> C:\alltoolchains\version2\include\stdio.h
> The user is confused because according to him, the current active version is
> version2.
> My question is:
> Is there any api which can be called prior to calling
> UpdateIndexWithModifiedFilesAction, which will examine the index and delete
> all header files in the index which are not included from the Include tab of
> the Paths and Symbols properties page?
> Thanks in advance.
> Thanks
> Abeer Bagul
> Tensilica India
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx

Back to the top