Minor: rename in KtPsiFactory
This commit is contained in:
@@ -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 =
|
||||
|
||||
+1
-1
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -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)
|
||||
|
||||
+1
-1
@@ -189,7 +189,7 @@ class KotlinCallableDefinitionUsage<T : PsiElement>(
|
||||
}
|
||||
}
|
||||
else {
|
||||
newParameterList = psiFactory.createFunctionLiteralParameterList(changeInfo.getNewParametersSignatureWithoutParentheses(this))
|
||||
newParameterList = psiFactory.createLambdaParameterList(changeInfo.getNewParametersSignatureWithoutParentheses(this))
|
||||
canReplaceEntireList = true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user