Reordered parameters

This commit is contained in:
Valentin Kipyatkov
2015-07-09 20:00:17 +03:00
parent 63614c5892
commit 92349e41ec
4 changed files with 6 additions and 6 deletions
@@ -60,8 +60,8 @@ public class ReferenceVariantsHelper(
public fun getReferenceVariants(
expression: JetSimpleNameExpression,
kindFilter: DescriptorKindFilter,
useRuntimeReceiverType: Boolean,
nameFilter: (Name) -> Boolean
nameFilter: (Name) -> Boolean,
useRuntimeReceiverType: Boolean = false
): Collection<DeclarationDescriptor> {
val variants = getReferenceVariantsNoVisibilityFilter(expression, kindFilter, useRuntimeReceiverType, nameFilter)
.filter(visibilityFilter)
@@ -209,7 +209,7 @@ abstract class CompletionSession(protected val configuration: CompletionSessionC
protected val referenceVariants: Collection<DeclarationDescriptor> by Delegates.lazy {
if (descriptorKindFilter != null) {
val expression = reference!!.expression
referenceVariantsHelper.getReferenceVariants(expression, descriptorKindFilter!!, false, prefixMatcher.asNameFilter())
referenceVariantsHelper.getReferenceVariants(expression, descriptorKindFilter!!, prefixMatcher.asNameFilter())
.excludeNonInitializedVariable(expression)
}
else {
@@ -231,7 +231,7 @@ abstract class CompletionSession(protected val configuration: CompletionSessionC
}
protected fun getRuntimeReceiverTypeReferenceVariants(): Collection<DeclarationDescriptor> {
val descriptors = referenceVariantsHelper.getReferenceVariants(reference!!.expression, descriptorKindFilter!!, true, prefixMatcher.asNameFilter())
val descriptors = referenceVariantsHelper.getReferenceVariants(reference!!.expression, descriptorKindFilter!!, prefixMatcher.asNameFilter(), useRuntimeReceiverType = true)
return descriptors.filter { descriptor ->
referenceVariants.none { comparePossiblyOverridingDescriptors(project, it, descriptor) }
}
@@ -81,7 +81,7 @@ class UsePropertyAccessSyntaxIntention : JetSelfTargetingOffsetIndependentIntent
val referenceVariantsHelper = ReferenceVariantsHelper(bindingContext, moduleDescriptor, callExpression.getProject(), ::isVisible)
val propertyName = property.getName()
val accessibleVariables = referenceVariantsHelper.getReferenceVariants(callee, DescriptorKindFilter.VARIABLES, false, { it == propertyName })
val accessibleVariables = referenceVariantsHelper.getReferenceVariants(callee, DescriptorKindFilter.VARIABLES, { it == propertyName })
if (property !in accessibleVariables) return null // shadowed by something else
return property
@@ -414,7 +414,7 @@ public class JetFunctionParameterInfoHandler implements ParameterInfoHandlerWith
};
Collection<DeclarationDescriptor> variants = new ReferenceVariantsHelper(bindingContext, moduleDescriptor, file.getProject(), visibilityFilter).getReferenceVariants(
callNameExpression, new DescriptorKindFilter(DescriptorKindFilter.FUNCTIONS_MASK | DescriptorKindFilter.CLASSIFIERS_MASK,
Collections.<DescriptorKindExclude>emptyList()), false, nameFilter);
Collections.<DescriptorKindExclude>emptyList()), nameFilter, false);
Collection<Pair<? extends DeclarationDescriptor, ResolutionFacade>> itemsToShow = new ArrayList<Pair<? extends DeclarationDescriptor, ResolutionFacade>>();
for (DeclarationDescriptor variant : variants) {