Minor changes after code review
This commit is contained in:
+1
-1
@@ -28,7 +28,7 @@ import com.intellij.psi.search.GlobalSearchScope
|
||||
|
||||
public class JavaPackageImpl(psiPackage: PsiPackage, private val scope: GlobalSearchScope) : JavaElementImpl<PsiPackage>(psiPackage), JavaPackage {
|
||||
|
||||
override fun getClasses(nameFilter: (Name) -> Boolean): MutableCollection<JavaClass> {
|
||||
override fun getClasses(nameFilter: (Name) -> Boolean): Collection<JavaClass> {
|
||||
val psiClasses = getPsi().getClasses(scope).filter {
|
||||
val name = it.getName()
|
||||
name != null && nameFilter(Name.identifier(name))
|
||||
|
||||
+4
@@ -49,6 +49,8 @@ public abstract class LazyJavaMemberScope(
|
||||
protected val c: LazyJavaResolverContextWithTypes,
|
||||
private val containingDeclaration: DeclarationDescriptor
|
||||
) : JetScope {
|
||||
// this lazy value is not used at all in LazyPackageFragmentScopeForJavaPackage because we do not use caching there
|
||||
// but is placed in the base class to not duplicate code
|
||||
private val allDescriptors = c.storageManager.createRecursionTolerantLazyValue<Collection<DeclarationDescriptor>>(
|
||||
{ computeDescriptors(JetScope.ALL_KINDS_MASK, JetScope.ALL_NAME_FILTER) },
|
||||
// This is to avoid the following recursive case:
|
||||
@@ -280,6 +282,8 @@ public abstract class LazyJavaMemberScope(
|
||||
}
|
||||
|
||||
override fun getProperties(name: Name): Collection<VariableDescriptor> = properties(name)
|
||||
|
||||
// we do not have nameFilter here because it only makes sense in package but java package does not contain any properties
|
||||
protected open fun getAllPropertyNames(): Collection<Name> = memberIndex().getAllFieldNames()
|
||||
|
||||
override fun getLocalVariable(name: Name): VariableDescriptor? = null
|
||||
|
||||
+2
-1
@@ -63,7 +63,8 @@ public class StubBasedPackageMemberDeclarationProvider(
|
||||
.stream()
|
||||
.map { FqName(it) }
|
||||
.filter { !it.isRoot() && it.parent() == fqName && nameFilter(it.shortName()) }
|
||||
.flatMapTo(this) { index[it.asString(), project, searchScope].stream() }
|
||||
.toSet()
|
||||
.flatMapTo(this) { index[it.asString(), project, searchScope] }
|
||||
}
|
||||
|
||||
override fun getClassOrObjectDeclarations(name: Name): Collection<JetClassLikeInfo> {
|
||||
|
||||
Reference in New Issue
Block a user