don't resolve from android classes to android source (IDEA-141587)

This commit is contained in:
peter
2015-07-12 23:25:21 +02:00
parent 6089157d9c
commit 93be085a46
3 changed files with 31 additions and 31 deletions
@@ -22,12 +22,9 @@ package com.intellij.psi.impl.search;
import com.intellij.ide.highlighter.JavaClassFileType;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.JdkOrderEntry;
import com.intellij.openapi.roots.OrderEntry;
import com.intellij.openapi.roots.ProjectFileIndex;
import com.intellij.openapi.roots.ProjectRootManager;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.SdkResolveScopeProvider;
import com.intellij.psi.search.DelegatingGlobalSearchScope;
import com.intellij.psi.search.GlobalSearchScope;
import org.jetbrains.annotations.NotNull;
@@ -66,27 +63,8 @@ public class JavaSourceFilterScope extends DelegatingGlobalSearchScope {
return myIndex.isInLibraryClasses(file);
}
if (myIndex.isInSourceContent(file)) {
return true;
}
final Project project = getProject();
if (project != null) {
for (OrderEntry entry : myIndex.getOrderEntriesForFile(file)) {
if (entry instanceof JdkOrderEntry) {
final JdkOrderEntry jdkOrderEntry = (JdkOrderEntry)entry;
for (SdkResolveScopeProvider provider : SdkResolveScopeProvider.EP_NAME.getExtensions()) {
final GlobalSearchScope scope = provider.getScope(project, jdkOrderEntry);
if (scope != null && scope.contains(file)) {
return true;
}
}
}
}
}
return false;
return myIndex.isInSourceContent(file) ||
myBaseScope.isForceSearchingInLibrarySources() && myIndex.isInLibrarySource(file);
}
}