Minor: rename in KtPsiFactory

This commit is contained in:
Mikhail Glukhikh
2016-11-24 15:19:58 +03:00
parent b111d1ba69
commit 9c75324188
4 changed files with 4 additions and 4 deletions
@@ -325,7 +325,7 @@ class KtPsiFactory(private val project: Project) {
fun createTypeParameter(text: String) = createTypeParameterList("<$text>").parameters.first()!!
fun createFunctionLiteralParameterList(text: String) =
fun createLambdaParameterList(text: String) =
createLambdaExpression(text, "0").functionLiteral.valueParameterList!!
fun createLambdaExpression(parameters: String, body: String): KtLambdaExpression =
@@ -32,7 +32,7 @@ class RemoveExplicitLambdaParameterTypesIntention : SelfTargetingIntention<KtLam
val oldParameterList = element.functionLiteral.valueParameterList!!
val parameterString = oldParameterList.parameters.map { it.name }.joinToString(", ")
val newParameterList = KtPsiFactory(element).createFunctionLiteralParameterList(parameterString)
val newParameterList = KtPsiFactory(element).createLambdaParameterList(parameterString)
oldParameterList.replace(newParameterList)
}
}
@@ -54,7 +54,7 @@ class SpecifyExplicitLambdaSignatureIntention : SelfTargetingIntention<KtLambdaE
.map { "${it.name}: ${IdeDescriptorRenderers.SOURCE_CODE.renderType(it.type)}" }
.joinToString(", ")
val newParameterList = psiFactory.createFunctionLiteralParameterList(parameterString)
val newParameterList = psiFactory.createLambdaParameterList(parameterString)
val oldParameterList = functionLiteral.valueParameterList
if (oldParameterList != null) {
oldParameterList.replace(newParameterList)
@@ -189,7 +189,7 @@ class KotlinCallableDefinitionUsage<T : PsiElement>(
}
}
else {
newParameterList = psiFactory.createFunctionLiteralParameterList(changeInfo.getNewParametersSignatureWithoutParentheses(this))
newParameterList = psiFactory.createLambdaParameterList(changeInfo.getNewParametersSignatureWithoutParentheses(this))
canReplaceEntireList = true
}
}