mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java] un-excludes multi-release module-info.class files (IDEA-164460)
This commit is contained in:
+1
-1
@@ -57,7 +57,7 @@ public class JavaModuleNameIndex extends StringStubIndexExtension<PsiJavaModule>
|
||||
|
||||
@Override
|
||||
public Collection<PsiJavaModule> get(@NotNull String name, @NotNull Project project, @NotNull GlobalSearchScope scope) {
|
||||
Collection<PsiJavaModule> modules = StubIndex.getElements(getKey(), name, project, new JavaSourceFilterScope(scope), PsiJavaModule.class);
|
||||
Collection<PsiJavaModule> modules = StubIndex.getElements(getKey(), name, project, new JavaSourceFilterScope(scope, true), PsiJavaModule.class);
|
||||
if (modules.size() > 1) {
|
||||
modules = filterVersions(project, modules);
|
||||
}
|
||||
|
||||
@@ -30,12 +30,17 @@ import org.jetbrains.annotations.Nullable;
|
||||
*/
|
||||
public class JavaSourceFilterScope extends DelegatingGlobalSearchScope {
|
||||
private final @Nullable ProjectFileIndex myIndex;
|
||||
private final boolean myIncludeVersions;
|
||||
|
||||
public JavaSourceFilterScope(@NotNull final GlobalSearchScope delegate) {
|
||||
public JavaSourceFilterScope(@NotNull GlobalSearchScope delegate) {
|
||||
this(delegate, false);
|
||||
}
|
||||
|
||||
public JavaSourceFilterScope(@NotNull GlobalSearchScope delegate, boolean includeVersions) {
|
||||
super(delegate);
|
||||
|
||||
Project project = getProject();
|
||||
myIndex = project == null ? null : ProjectRootManager.getInstance(project).getFileIndex();
|
||||
myIncludeVersions = includeVersions;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -49,7 +54,7 @@ public class JavaSourceFilterScope extends DelegatingGlobalSearchScope {
|
||||
}
|
||||
|
||||
if (JavaClassFileType.INSTANCE == file.getFileType()) {
|
||||
return myIndex.isInLibraryClasses(file) && !isVersioned(file);
|
||||
return myIndex.isInLibraryClasses(file) && (myIncludeVersions || !isVersioned(file));
|
||||
}
|
||||
|
||||
return myIndex.isInSourceContent(file) ||
|
||||
|
||||
Reference in New Issue
Block a user