Package org.eclipse.cdt.core.index
Interface IIndexManager
- All Superinterfaces:
IPDOMManager
Starting point for working with the index. The manager can be obtained via
CCorePlugin.getIndexManager()
.- Since:
- 4.0
- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Constant for passing to getIndex methods.static final int
Constant for passing to getIndex methods.static final int
Constant for passing to getIndex methods.static final int
Constant for passing to getIndex methods.static final int
Constant for passing to getIndex methods.static final int
Constant for passing to getIndex methods.static final int
Constant for passing to getIndex methods.static final int
Constant for passing to getIndex methods.static final int
Constant for passing to getIndex methods.static final int
Constant for passing to getIndex methods.static final int
Include files that are otherwise would be excluded from the index.static final int
Constant for indicating that there is no time out period for joining the indexer job.static final int
Causes files previously included in the index due to FORCE_INDEX_INCLUSION to loose their index inclusion privilege.static final int
Deprecated.Extension fragments are now used depending on their configuration.static final int
Constant for requesting an update of all translation units.static final int
Constant for requesting an update of translation units if their configurations have changed.static final int
This flag modifies behavior of UPDATE_CHECK_TIMESTAMPS.static final int
Constant for requesting an update of translation units if their timestamps have changed.static final int
Constant for requesting to update the external files for a project, also.static final int
Constant for requesting an update of translation units that had unresolved includes.Fields inherited from interface org.eclipse.cdt.core.dom.IPDOMManager
ID_FAST_INDEXER, ID_FULL_INDEXER, ID_NO_INDEXER
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addIndexChangeListener
(IIndexChangeListener listener) Registers a listener that will be notified whenever the indexer go idle.void
addIndexerSetupParticipant
(IndexerSetupParticipant participant) Adds a participant for the indexer-setupvoid
addIndexerStateListener
(IIndexerStateListener listener) Registers a listener that will be notified whenever the indexer changes its state.void
export
(ICProject project, String location, int options, org.eclipse.core.runtime.IProgressMonitor monitor) Exports index for usage within a team.Returns the index for the given project.Returns the index for the given projects.Returns the index for the given projects.Returns the index for the given project.getIndexerId
(ICProject project) Returns the id of the indexer working on the project.boolean
Checks whether the indexer is currently idle.boolean
Returns whether the indexer-setup for a project is currently postponed.boolean
isProjectContentSynced
(ICProject cproject) boolean
isProjectIndexed
(ICProject proj) Returns whether an indexer is selected for the project.boolean
joinIndexer
(int waitMaxMillis, org.eclipse.core.runtime.IProgressMonitor monitor) Joins the indexer and reports progress.void
Clears the entire index of the project and schedules the indexer.void
Removes a previously registered index change listener.void
removeIndexerSetupParticipant
(IndexerSetupParticipant participant) Removes a participant for the indexer-setupvoid
Removes a previously registered indexer state listener.void
setIndexerId
(ICProject project, String indexerId) Changes the indexer working on the project.void
Updates the index for the given selection of translation units considering the options supplied.Methods inherited from interface org.eclipse.cdt.core.dom.IPDOMManager
getDefaultIndexerId, setDefaultIndexerId
-
Field Details
-
ADD_DEPENDENCIES
static final int ADD_DEPENDENCIESConstant for passing to getIndex methods. This constant, when set, indicates projects referenced by the set of input projects should also be added to the resulting index.- See Also:
-
ADD_DEPENDENT
static final int ADD_DEPENDENTConstant for passing to getIndex methods. This constant, when set, indicates projects which reference any of the set of input projects should also be added to the resulting index.- See Also:
-
SKIP_PROVIDED
Deprecated.Extension fragments are now used depending on their configuration. Use one of the ADD_EXTENSION_XX flags instead.- See Also:
- Restriction:
- This field is not intended to be referenced by clients.
-
ADD_EXTENSION_FRAGMENTS_NAVIGATION
static final int ADD_EXTENSION_FRAGMENTS_NAVIGATIONConstant for passing to getIndex methods. This constant, when set, indicates that each index content provided via the ReadOnlyIndexFragmentProvider or ReadOnlyPDOMProvider, which is not disabled for navigation shall be included in the resulting index.- Since:
- 5.4
- See Also:
-
ADD_EXTENSION_FRAGMENTS_CONTENT_ASSIST
static final int ADD_EXTENSION_FRAGMENTS_CONTENT_ASSISTConstant for passing to getIndex methods. This constant, when set, indicates that the each index content provided via the ReadOnlyIndexFragmentProvider or ReadOnlyPDOMProvider, which is not disabled for content assist shall be included in the resulting index.- Since:
- 5.4
- See Also:
-
ADD_EXTENSION_FRAGMENTS_ADD_IMPORT
static final int ADD_EXTENSION_FRAGMENTS_ADD_IMPORTConstant for passing to getIndex methods. This constant, when set, indicates that each index content provided via the ReadOnlyIndexFragmentProvider or ReadOnlyPDOMProvider, which is not disabled for add import shall be included in the resulting index.- Since:
- 5.4
- See Also:
-
ADD_EXTENSION_FRAGMENTS_CALL_HIERARCHY
static final int ADD_EXTENSION_FRAGMENTS_CALL_HIERARCHYConstant for passing to getIndex methods. This constant, when set, indicates that each index content provided via the ReadOnlyIndexFragmentProvider or ReadOnlyPDOMProvider, which is not disabled for the call hierarchy shall be included in the resulting index.- Since:
- 5.4
- See Also:
-
ADD_EXTENSION_FRAGMENTS_TYPE_HIERARCHY
static final int ADD_EXTENSION_FRAGMENTS_TYPE_HIERARCHYConstant for passing to getIndex methods. This constant, when set, indicates that each index content provided via the ReadOnlyIndexFragmentProvider or ReadOnlyPDOMProvider, which is not disabled for the type hierarchy shall be included in the resulting index.- Since:
- 5.4
- See Also:
-
ADD_EXTENSION_FRAGMENTS_INCLUDE_BROWSER
static final int ADD_EXTENSION_FRAGMENTS_INCLUDE_BROWSERConstant for passing to getIndex methods. This constant, when set, indicates that each index content provided via the ReadOnlyIndexFragmentProvider or ReadOnlyPDOMProvider, which is not disabled for the include browser shall be included in the resulting index.- Since:
- 5.4
- See Also:
-
ADD_EXTENSION_FRAGMENTS_SEARCH
static final int ADD_EXTENSION_FRAGMENTS_SEARCHConstant for passing to getIndex methods. This constant, when set, indicates that each index content provided via the ReadOnlyIndexFragmentProvider or ReadOnlyPDOMProvider, which is not disabled for the search shall be included in the resulting index.- Since:
- 5.4
- See Also:
-
ADD_EXTENSION_FRAGMENTS_EDITOR
static final int ADD_EXTENSION_FRAGMENTS_EDITORConstant for passing to getIndex methods. This constant, when set, indicates that each index content provided via the ReadOnlyIndexFragmentProvider or ReadOnlyPDOMProvider, which is not disabled for the editor shall be included in the resulting index.- Since:
- 5.5
- See Also:
-
FOREVER
static final int FOREVERConstant for indicating that there is no time out period for joining the indexer job. -
UPDATE_ALL
static final int UPDATE_ALLConstant for requesting an update of all translation units.- See Also:
-
UPDATE_CHECK_TIMESTAMPS
static final int UPDATE_CHECK_TIMESTAMPSConstant for requesting an update of translation units if their timestamps have changed.- See Also:
-
UPDATE_CHECK_CONFIGURATION
static final int UPDATE_CHECK_CONFIGURATIONConstant for requesting an update of translation units if their configurations have changed. The flag currently has no effect.- See Also:
-
UPDATE_EXTERNAL_FILES_FOR_PROJECT
static final int UPDATE_EXTERNAL_FILES_FOR_PROJECTConstant for requesting to update the external files for a project, also. This flag works only if it is used to update one or more projects. It shall be used together withUPDATE_ALL
orUPDATE_CHECK_TIMESTAMPS
.- Since:
- 5.1
- See Also:
-
UPDATE_CHECK_CONTENTS_HASH
static final int UPDATE_CHECK_CONTENTS_HASHThis flag modifies behavior of UPDATE_CHECK_TIMESTAMPS. Both, the timestamp and the hash of the contents of a translation unit, have to change in order to trigger re-indexing. Checking for content changes may reduce indexing overhead for projects that use code generation since generated files are sometimes recreated with identical contents.- Since:
- 5.2
- See Also:
-
FORCE_INDEX_INCLUSION
static final int FORCE_INDEX_INCLUSIONInclude files that are otherwise would be excluded from the index. This flag is sticky for the duration of the Eclipse session. If the files are later updated without this flag, they remain in the index.- Since:
- 5.3
- See Also:
-
RESET_INDEX_INCLUSION
static final int RESET_INDEX_INCLUSIONCauses files previously included in the index due to FORCE_INDEX_INCLUSION to loose their index inclusion privilege. The files included only due to FORCE_INDEX_INCLUSION, will be removed from the index.- Since:
- 5.4
- See Also:
-
UPDATE_UNRESOLVED_INCLUDES
static final int UPDATE_UNRESOLVED_INCLUDESConstant for requesting an update of translation units that had unresolved includes.- Since:
- 5.4
- See Also:
-
-
Method Details
-
getIndex
Returns the index for the given project.- Parameters:
project
- the project to get the index for- Returns:
- an index for the project
- Throws:
org.eclipse.core.runtime.CoreException
-
getIndex
Returns the index for the given projects.- Parameters:
projects
- the projects to get the index for- Returns:
- an index for the projects
- Throws:
org.eclipse.core.runtime.CoreException
-
getIndex
Returns the index for the given project. You can specify to add dependencies or dependent projects.- Parameters:
project
- the project to get the index foroptions
-0
or a combination ofADD_DEPENDENCIES
andADD_DEPENDENT
.- Returns:
- an index for the project
- Throws:
org.eclipse.core.runtime.CoreException
-
getIndex
Returns the index for the given projects. You can specify to add dependencies or dependent projects.- Parameters:
projects
- the projects to get the index foroptions
-0
or a combination ofADD_DEPENDENCIES
andADD_DEPENDENT
.- Returns:
- an index for the projects
- Throws:
org.eclipse.core.runtime.CoreException
-
addIndexChangeListener
Registers a listener that will be notified whenever the indexer go idle.- Parameters:
listener
- the listener to register.
-
removeIndexChangeListener
Removes a previously registered index change listener.- Parameters:
listener
- the listener to unregister.
-
addIndexerStateListener
Registers a listener that will be notified whenever the indexer changes its state.- Parameters:
listener
- the listener to register.
-
removeIndexerStateListener
Removes a previously registered indexer state listener.- Parameters:
listener
- the listener to unregister.
-
joinIndexer
boolean joinIndexer(int waitMaxMillis, org.eclipse.core.runtime.IProgressMonitor monitor) Joins the indexer and reports progress.- Parameters:
waitMaxMillis
- time limit in milliseconds after which the method returns withfalse
, orFOREVER
.monitor
- a monitor to report progress.- Returns:
true
, if the indexer went idle in the given time.
-
isIndexerIdle
boolean isIndexerIdle()Checks whether the indexer is currently idle. The indexer is idle, when there is currently no request to update files of an index and no initialization for a project is performed. However, the indexer becomes idle, when the setup of a project is postponed (check withisIndexerSetupPostponed(ICProject)
). -
isProjectIndexed
Returns whether an indexer is selected for the project.- Since:
- 4.0
-
isProjectContentSynced
- Parameters:
cproject
- the project to check- Returns:
- whether the content in the project fragment of the specified project's index is complete (contains all sources) and up to date.
- Throws:
org.eclipse.core.runtime.CoreException
- Since:
- 6.4
-
isIndexerSetupPostponed
Returns whether the indexer-setup for a project is currently postponed. Note, that a postponed setup does not prevent the indexer from becoming idle (isIndexerIdle()
.The fact that the indexer-setup for a project is no longer postponed, will be reported using
IndexerSetupParticipant.onIndexerSetup(ICProject)
. -
getIndexerId
Returns the id of the indexer working on the project.- Specified by:
getIndexerId
in interfaceIPDOMManager
- Since:
- 4.0
-
setIndexerId
Changes the indexer working on the project.- Specified by:
setIndexerId
in interfaceIPDOMManager
- Since:
- 4.0
-
reindex
Clears the entire index of the project and schedules the indexer.- Since:
- 4.0
-
update
Updates the index for the given selection of translation units considering the options supplied. The selection is defined by an array of translation units, containers and projects. For containers and projects all recursively nested translation units are considered.- Parameters:
tuSelection
- the translation units to update.options
- one ofUPDATE_ALL
orUPDATE_CHECK_TIMESTAMPS
optionally combined withUPDATE_EXTERNAL_FILES_FOR_PROJECT
andUPDATE_CHECK_CONTENTS_HASH
.- Throws:
org.eclipse.core.runtime.CoreException
- Since:
- 4.0
-
export
void export(ICProject project, String location, int options, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException Exports index for usage within a team.- Parameters:
project
- a project for which the PDOM is to be exported.location
- the target location for the database.options
- currently none are supported.- Throws:
org.eclipse.core.runtime.CoreException
- Since:
- 4.0
-
addIndexerSetupParticipant
Adds a participant for the indexer-setup -
removeIndexerSetupParticipant
Removes a participant for the indexer-setup
-