Convert Receiver to Parameter: Use template instead of the dialog
#KT-9490 Fixed
This commit is contained in:
@@ -285,4 +285,11 @@ fun KtTypeParameterListOwner.addTypeParameter(typeParameter: KtTypeParameter): K
|
||||
else -> null
|
||||
} ?: return null
|
||||
return (addAfter(list, leftAnchor) as KtTypeParameterList).parameters.first()
|
||||
}
|
||||
|
||||
fun KtNamedFunction.getOrCreateValueParameterList(): KtParameterList {
|
||||
valueParameterList?.let { return it }
|
||||
val parameterList = KtPsiFactory(this).createParameterList("()")
|
||||
val anchor = nameIdentifier ?: funKeyword!!
|
||||
return addAfter(parameterList, anchor) as KtParameterList
|
||||
}
|
||||
Reference in New Issue
Block a user