Code completion: minor changes after code review
This commit is contained in:
@@ -57,7 +57,7 @@ class ExpectedInfos(val bindingContext: BindingContext, val moduleDescriptor: Mo
|
||||
val callExpression = expressionWithType.getParent() as? JetCallExpression
|
||||
if (callExpression != null) {
|
||||
val arguments = callExpression.getFunctionLiteralArguments()
|
||||
if (arguments.size > 0 && arguments[0] == expressionWithType) {
|
||||
if (arguments.firstOrNull() == expressionWithType) {
|
||||
return calculateForArgument(callExpression, callExpression.getValueArguments().size, true)
|
||||
}
|
||||
}
|
||||
@@ -103,7 +103,7 @@ class ExpectedInfos(val bindingContext: BindingContext, val moduleDescriptor: Mo
|
||||
if (isFunctionLiteralArgument) {
|
||||
if (argumentIndex != parameters.size - 1) continue
|
||||
}
|
||||
else{
|
||||
else {
|
||||
if (parameters.size <= argumentIndex) continue
|
||||
}
|
||||
val parameterDescriptor = parameters[argumentIndex]
|
||||
|
||||
@@ -100,7 +100,7 @@ public class JetCompletionResultSet {
|
||||
LookupElement lookupElement = DescriptorLookupConverter.createLookupElement(resolveSession, bindingContext, descriptor);
|
||||
addElement(new LookupElementDecorator<LookupElement>(lookupElement) {
|
||||
@Override
|
||||
public void renderElement(LookupElementPresentation presentation) {
|
||||
public void renderElement(@NotNull LookupElementPresentation presentation) {
|
||||
super.renderElement(presentation);
|
||||
presentation.setItemText(getLookupString() + " " + HandlersPackage.buildLambdaPresentation(parameterType));
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ private fun needExplicitParameterTypes(context: InsertionContext, placeholderRan
|
||||
if (functionTypes.size <= 1) return false
|
||||
|
||||
val lambdaParameterCount = KotlinBuiltIns.getInstance().getParameterTypeProjectionsFromFunctionType(lambdaType).size
|
||||
return functionTypes.filter { KotlinBuiltIns.getInstance().getParameterTypeProjectionsFromFunctionType(it).size == lambdaParameterCount}.size > 1
|
||||
return functionTypes.filter { KotlinBuiltIns.getInstance().getParameterTypeProjectionsFromFunctionType(it).size == lambdaParameterCount }.size > 1
|
||||
}
|
||||
|
||||
private fun buildTemplate(lambdaType: JetType, explicitParameterTypes: Boolean, project: Project): Template {
|
||||
|
||||
Reference in New Issue
Block a user