GlobalSearchScope (final VirtualFile file) { if (myMainScope.contains(file)) return myMainScope; //noinspection ForLoopReplaceableByForEach for (int i = 0, size = myScopes.size(); i < size; i++) { GlobalSearchScope scope = myScopes.get(i); if (scope.contains(file)) return scope; } return null; }