if (camelCaseMatch) matchRule |= SearchPattern.R_CAMELCASE_MATCH;
if (monitor != null) {
IndexManager indexManager = JavaModelManager.getIndexManager();
if (indexManager.awaitingJobsCount() == 0) {
// indexes were already there, so perform an immediate search to avoid any index rebuilt
new BasicSearchEngine(this.workingCopies).searchAllTypeNames(
qualification,
SearchPattern.R_EXACT_MATCH,
simpleName,
matchRule, // not case sensitive
searchFor,
getSearchScope(),
typeRequestor,
FORCE_IMMEDIATE_SEARCH,
progressMonitor);
} else {
// indexes were not ready, give the indexing a chance to finish small jobs by sleeping 100ms...
try {
Thread.sleep(100);
} catch (InterruptedException e) {
// Do nothing
}
if (monitor.isCanceled()) {
throw new OperationCanceledException();
}
if (indexManager.awaitingJobsCount() == 0) {
// indexes are now ready, so perform an immediate search to avoid any index rebuilt
new BasicSearchEngine(this.workingCopies).searchAllTypeNames(
qualification,
SearchPattern.R_EXACT_MATCH,
simpleName,
matchRule, // not case sensitive
searchFor,
getSearchScope(),
typeRequestor,
FORCE_IMMEDIATE_SEARCH,
progressMonitor);
} else {
// Indexes are still not ready, so look for types in the model instead of a search request
findTypes(
new String(prefix),
storage,
convertSearchFilterToModelFilter(searchFor));
}
}
} else {
try {
new BasicSearchEngine(this.workingCopies).searchAllTypeNames(
qualification,
SearchPattern.R_EXACT_MATCH,
simpleName,
matchRule, // not case sensitive
searchFor,