Android: Add inspection & quickfix to convert findViewById to api 26
#KT-19940 Fixed Target Version 1.1.5
This commit is contained in:
@@ -533,6 +533,15 @@ fun KtCallExpression.getOrCreateValueArgumentList(): KtValueArgumentList {
|
||||
typeArgumentList ?: calleeExpression) as KtValueArgumentList
|
||||
}
|
||||
|
||||
fun KtCallExpression.addTypeArgument(typeArgument: KtTypeProjection) {
|
||||
if (typeArgumentList != null) {
|
||||
typeArgumentList?.addArgument(typeArgument)
|
||||
}
|
||||
else {
|
||||
addAfter(KtPsiFactory(this).createTypeArguments("<${typeArgument.text}>"), calleeExpression)
|
||||
}
|
||||
}
|
||||
|
||||
fun KtDeclaration.hasBody() = when (this) {
|
||||
is KtFunction -> hasBody()
|
||||
is KtProperty -> hasBody()
|
||||
|
||||
Reference in New Issue
Block a user