IDEA-25332 spring: also recognize classes with scope != compile

This commit is contained in:
Dmitry Avdeev
2011-02-07 16:13:26 +03:00
parent 9c6a056fa0
commit 1f6fbdab22
3 changed files with 5 additions and 3 deletions
@@ -111,7 +111,8 @@ public class PsiClassConverter extends Converter<PsiClass> implements CustomRefe
VirtualFile virtualFile = file.getVirtualFile();
if (virtualFile == null) return null;
ProjectFileIndex fileIndex = ProjectRootManager.getInstance(file.getProject()).getFileIndex();
return GlobalSearchScope.moduleRuntimeScope(module, fileIndex.isInTestSourceContent(virtualFile));
boolean tests = fileIndex.isInTestSourceContent(virtualFile);
return module.getModuleRuntimeScope(tests).union(module.getModuleWithDependenciesAndLibrariesScope(tests));
}
public static class AnnotationType extends PsiClassConverter {
@@ -50,7 +50,8 @@ public class DomJavaUtil {
}
else {
ProjectFileIndex fileIndex = ProjectRootManager.getInstance(file.getProject()).getFileIndex();
scope = GlobalSearchScope.moduleRuntimeScope(module, fileIndex.isInTestSourceContent(virtualFile));
boolean tests = fileIndex.isInTestSourceContent(virtualFile);
scope = module.getModuleRuntimeScope(tests).union(module.getModuleWithDependenciesAndLibrariesScope(tests));
}
}
else {
@@ -63,6 +63,6 @@ public abstract class ClassValueConverter extends Converter<PsiClass> implements
}
final boolean inTests = ProjectRootManager.getInstance(project).getFileIndex().isInTestSourceContent(file);
return module.getModuleRuntimeScope(inTests);
return module.getModuleRuntimeScope(inTests).union(module.getModuleWithDependenciesAndLibrariesScope(inTests));
}
}