Renamed methods in MemberScope from getSmth to getContributedSmth

This commit is contained in:
Stanislav Erokhin
2015-11-04 14:46:59 +03:00
parent 6f9d9759ce
commit 2c3f58eeb7
104 changed files with 289 additions and 288 deletions
@@ -42,17 +42,17 @@ public fun LexicalScope.getAllAccessibleVariables(name: Name): Collection<Variab
}
public fun LexicalScope.getAllAccessibleFunctions(name: Name): Collection<FunctionDescriptor> {
return getImplicitReceiversWithInstance().flatMap { it.type.memberScope.getFunctions(name, NoLookupLocation.FROM_IDE) } +
collectFunctions(name, NoLookupLocation.FROM_IDE)
return getImplicitReceiversWithInstance().flatMap { it.type.memberScope.getContributedFunctions(name, NoLookupLocation.FROM_IDE) } +
collectFunctions(name, NoLookupLocation.FROM_IDE)
}
public fun LexicalScope.getVariablesFromImplicitReceivers(name: Name): Collection<VariableDescriptor> = getImplicitReceiversWithInstance().flatMap {
it.type.memberScope.getProperties(name, NoLookupLocation.FROM_IDE)
it.type.memberScope.getContributedVariables(name, NoLookupLocation.FROM_IDE)
}
public fun LexicalScope.getVariableFromImplicitReceivers(name: Name): VariableDescriptor? {
getImplicitReceiversWithInstance().forEach {
it.type.memberScope.getProperties(name, NoLookupLocation.FROM_IDE).singleOrNull()?.let { return it }
it.type.memberScope.getContributedVariables(name, NoLookupLocation.FROM_IDE).singleOrNull()?.let { return it }
}
return null
}
@@ -61,7 +61,7 @@ public fun descriptorsEqualWithSubstitution(descriptor1: DeclarationDescriptor?,
public fun ClassDescriptor.findCallableMemberBySignature(signature: CallableMemberDescriptor): CallableMemberDescriptor? {
val descriptorKind = if (signature is FunctionDescriptor) DescriptorKindFilter.FUNCTIONS else DescriptorKindFilter.VARIABLES
return getDefaultType().getMemberScope()
.getDescriptors(descriptorKind)
.getContributedDescriptors(descriptorKind)
.filterIsInstance<CallableMemberDescriptor>()
.firstOrNull {
it.getContainingDeclaration() == this