diff --git a/java/java-impl/src/com/intellij/util/xml/PsiClassConverter.java b/java/java-impl/src/com/intellij/util/xml/PsiClassConverter.java index 06f3f70cd596..c200d37825dd 100644 --- a/java/java-impl/src/com/intellij/util/xml/PsiClassConverter.java +++ b/java/java-impl/src/com/intellij/util/xml/PsiClassConverter.java @@ -111,7 +111,8 @@ public class PsiClassConverter extends Converter 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 { diff --git a/java/openapi/src/com/intellij/util/xml/DomJavaUtil.java b/java/openapi/src/com/intellij/util/xml/DomJavaUtil.java index 996af38a3a63..0c2b022ac941 100644 --- a/java/openapi/src/com/intellij/util/xml/DomJavaUtil.java +++ b/java/openapi/src/com/intellij/util/xml/DomJavaUtil.java @@ -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 { diff --git a/java/openapi/src/com/intellij/util/xml/converters/values/ClassValueConverter.java b/java/openapi/src/com/intellij/util/xml/converters/values/ClassValueConverter.java index cb2820c28a00..af9bee8c8a83 100644 --- a/java/openapi/src/com/intellij/util/xml/converters/values/ClassValueConverter.java +++ b/java/openapi/src/com/intellij/util/xml/converters/values/ClassValueConverter.java @@ -63,6 +63,6 @@ public abstract class ClassValueConverter extends Converter implements } final boolean inTests = ProjectRootManager.getInstance(project).getFileIndex().isInTestSourceContent(file); - return module.getModuleRuntimeScope(inTests); + return module.getModuleRuntimeScope(inTests).union(module.getModuleWithDependenciesAndLibrariesScope(inTests)); } }