Add location parameter to JetScope::getClassifier

This commit is contained in:
Zalim Bashorov
2015-07-14 22:15:59 +03:00
parent 0f92036353
commit e2e3520c3d
35 changed files with 71 additions and 63 deletions
@@ -35,12 +35,12 @@ import org.jetbrains.kotlin.load.java.structure.JavaArrayType
import org.jetbrains.kotlin.load.java.structure.JavaClass
import org.jetbrains.kotlin.load.java.structure.JavaConstructor
import org.jetbrains.kotlin.load.java.structure.JavaMethod
import org.jetbrains.kotlin.load.java.structure.*
import org.jetbrains.kotlin.load.java.typeEnhacement.enhanceSignatures
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.resolve.DescriptorFactory
import org.jetbrains.kotlin.resolve.DescriptorUtils
import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter
import org.jetbrains.kotlin.resolve.scopes.Location
import org.jetbrains.kotlin.types.JetType
import org.jetbrains.kotlin.types.TypeUtils
import org.jetbrains.kotlin.utils.*
@@ -285,7 +285,7 @@ public class LazyJavaClassMemberScope(
override fun getDispatchReceiverParameter(): ReceiverParameterDescriptor? =
DescriptorUtils.getDispatchReceiverParameterIfNeeded(getContainingDeclaration())
override fun getClassifier(name: Name): ClassifierDescriptor? = nestedClasses(name)
override fun getClassifier(name: Name, location: Location): ClassifierDescriptor? = nestedClasses(name)
override fun getClassNames(kindFilter: DescriptorKindFilter, nameFilter: (Name) -> Boolean): Collection<Name>
= nestedClassIndex().keySet() + enumEntryIndex().keySet()
@@ -16,14 +16,18 @@
package org.jetbrains.kotlin.load.java.lazy.descriptors
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.resolve.DescriptorUtils
import org.jetbrains.kotlin.name.*
import org.jetbrains.kotlin.descriptors.ClassifierDescriptor
import org.jetbrains.kotlin.descriptors.SimpleFunctionDescriptor
import org.jetbrains.kotlin.load.java.lazy.LazyJavaResolverContext
import org.jetbrains.kotlin.load.java.structure.JavaClass
import org.jetbrains.kotlin.resolve.DescriptorFactory.*
import org.jetbrains.kotlin.utils.addIfNotNull
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.resolve.DescriptorFactory.createEnumValueOfMethod
import org.jetbrains.kotlin.resolve.DescriptorFactory.createEnumValuesMethod
import org.jetbrains.kotlin.resolve.DescriptorUtils
import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter
import org.jetbrains.kotlin.resolve.scopes.Location
import org.jetbrains.kotlin.utils.addIfNotNull
public class LazyJavaStaticClassScope(
c: LazyJavaResolverContext,
@@ -54,7 +58,7 @@ public class LazyJavaStaticClassScope(
memberIndex().getAllFieldNames()
override fun getClassNames(kindFilter: DescriptorKindFilter, nameFilter: (Name) -> Boolean): Collection<Name> = listOf()
override fun getClassifier(name: Name): ClassifierDescriptor? = null
override fun getClassifier(name: Name, location: Location): ClassifierDescriptor? = null
override fun getSubPackages(): Collection<FqName> = listOf()
@@ -70,7 +70,7 @@ public class LazyPackageFragmentScopeForJavaPackage(
}
}
override fun getClassifier(name: Name): ClassifierDescriptor? = classes(name)
override fun getClassifier(name: Name, location: Location): ClassifierDescriptor? = classes(name)
override fun getProperties(name: Name, location: Location) = deserializedPackageScope().getProperties(name)
override fun getFunctions(name: Name, location: Location) = deserializedPackageScope().getFunctions(name) + super.getFunctions(name)