mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fix searching for usages outside of roots model (namely in objective-c frameworks).
This commit is contained in:
+2
-1
@@ -111,12 +111,13 @@ public class IndexCacheManagerImpl implements CacheManager{
|
||||
if (vFiles.isEmpty()) return true;
|
||||
|
||||
final ProjectFileIndex index = ProjectRootManager.getInstance(myProject).getFileIndex();
|
||||
final boolean globalScope = scope.isSearchOutsideRootModel();
|
||||
|
||||
final Processor<VirtualFile> virtualFileProcessor = new ReadActionProcessor<VirtualFile>() {
|
||||
@Override
|
||||
public boolean processInReadAction(VirtualFile virtualFile) {
|
||||
LOG.assertTrue(virtualFile.isValid());
|
||||
if (virtualFile.isValid() && scope.contains(virtualFile) && shouldBeFound(virtualFile, index)) {
|
||||
if (virtualFile.isValid() && scope.contains(virtualFile) && (globalScope || shouldBeFound(virtualFile, index))) {
|
||||
final PsiFile psiFile = myPsiManager.findFile(virtualFile);
|
||||
return psiFile == null || psiFileProcessor.process(psiFile);
|
||||
}
|
||||
|
||||
@@ -674,13 +674,14 @@ public class PsiSearchHelperImpl implements PsiSearchHelper {
|
||||
final GlobalSearchScope commonScope,
|
||||
final ProgressIndicator progress) {
|
||||
final MultiMap<VirtualFile, RequestWithProcessor> local = createMultiMap();
|
||||
final boolean inRootsOnly = !commonScope.isSearchOutsideRootModel();
|
||||
ApplicationManager.getApplication().runReadAction(new Runnable() {
|
||||
public void run() {
|
||||
if (progress != null) progress.checkCanceled();
|
||||
FileBasedIndex.getInstance().processValues(IdIndex.NAME, entry, null, new FileBasedIndex.ValueProcessor<Integer>() {
|
||||
public boolean process(VirtualFile file, Integer value) {
|
||||
if (progress != null) progress.checkCanceled();
|
||||
if (!IndexCacheManagerImpl.shouldBeFound(file, index)) {
|
||||
if (inRootsOnly && !IndexCacheManagerImpl.shouldBeFound(file, index)) {
|
||||
return true;
|
||||
}
|
||||
int mask = value.intValue();
|
||||
|
||||
Reference in New Issue
Block a user