Optimize contributedDescriptors
Take kindFilters into account on early stage. #KTIJ-23032
This commit is contained in:
committed by
teamcity
parent
c198d4d90d
commit
a32c660a67
@@ -67,9 +67,15 @@ class LazyExplicitImportScope(
|
|||||||
): Collection<DeclarationDescriptor> {
|
): Collection<DeclarationDescriptor> {
|
||||||
val descriptors = SmartList<DeclarationDescriptor>()
|
val descriptors = SmartList<DeclarationDescriptor>()
|
||||||
|
|
||||||
descriptors.addIfNotNull(getContributedClassifier(aliasName, NoLookupLocation.WHEN_GET_ALL_DESCRIPTORS))
|
if (kindFilter.acceptsKinds(DescriptorKindFilter.CLASSIFIERS_MASK)) {
|
||||||
descriptors.addAll(getContributedFunctions(aliasName, NoLookupLocation.WHEN_GET_ALL_DESCRIPTORS))
|
descriptors.addIfNotNull(getContributedClassifier(aliasName, NoLookupLocation.WHEN_GET_ALL_DESCRIPTORS))
|
||||||
descriptors.addAll(getContributedVariables(aliasName, NoLookupLocation.WHEN_GET_ALL_DESCRIPTORS))
|
}
|
||||||
|
if (kindFilter.acceptsKinds(DescriptorKindFilter.FUNCTIONS_MASK)) {
|
||||||
|
descriptors.addAll(getContributedFunctions(aliasName, NoLookupLocation.WHEN_GET_ALL_DESCRIPTORS))
|
||||||
|
}
|
||||||
|
if (kindFilter.acceptsKinds(DescriptorKindFilter.VARIABLES_MASK)) {
|
||||||
|
descriptors.addAll(getContributedVariables(aliasName, NoLookupLocation.WHEN_GET_ALL_DESCRIPTORS))
|
||||||
|
}
|
||||||
|
|
||||||
if (changeNamesForAliased && aliasName != declaredName) {
|
if (changeNamesForAliased && aliasName != declaredName) {
|
||||||
for (i in descriptors.indices) {
|
for (i in descriptors.indices) {
|
||||||
|
|||||||
Reference in New Issue
Block a user