ExclExclCallFixes: reformat
This commit is contained in:
@@ -74,8 +74,7 @@ class RemoveExclExclCallFix(psiElement: PsiElement) : ExclExclCallFix(psiElement
|
|||||||
}
|
}
|
||||||
|
|
||||||
companion object : KotlinSingleIntentionActionFactory() {
|
companion object : KotlinSingleIntentionActionFactory() {
|
||||||
override fun createAction(diagnostic: Diagnostic): IntentionAction
|
override fun createAction(diagnostic: Diagnostic): IntentionAction = RemoveExclExclCallFix(diagnostic.psiElement)
|
||||||
= RemoveExclExclCallFix(diagnostic.psiElement)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,8 +129,7 @@ class AddExclExclCallFix(psiElement: PsiElement, val checkImplicitReceivers: Boo
|
|||||||
if (checkImplicitReceivers && psiElement.getResolvedCall(context)?.getImplicitReceiverValue() != null) {
|
if (checkImplicitReceivers && psiElement.getResolvedCall(context)?.getImplicitReceiverValue() != null) {
|
||||||
val expressionToReplace = psiElement.parent as? KtCallExpression ?: psiElement
|
val expressionToReplace = psiElement.parent as? KtCallExpression ?: psiElement
|
||||||
expressionToReplace.expressionForCall(implicitReceiver = true)
|
expressionToReplace.expressionForCall(implicitReceiver = true)
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
context[BindingContext.EXPRESSION_TYPE_INFO, psiElement]?.let {
|
context[BindingContext.EXPRESSION_TYPE_INFO, psiElement]?.let {
|
||||||
val type = it.type
|
val type = it.type
|
||||||
if (type != null) {
|
if (type != null) {
|
||||||
@@ -153,7 +151,7 @@ class AddExclExclCallFix(psiElement: PsiElement, val checkImplicitReceivers: Boo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
object SmartCastImpossibleExclExclFixFactory: KotlinSingleIntentionActionFactory() {
|
object SmartCastImpossibleExclExclFixFactory : KotlinSingleIntentionActionFactory() {
|
||||||
override fun createAction(diagnostic: Diagnostic): IntentionAction? {
|
override fun createAction(diagnostic: Diagnostic): IntentionAction? {
|
||||||
if (diagnostic.factory !== Errors.SMARTCAST_IMPOSSIBLE) return null
|
if (diagnostic.factory !== Errors.SMARTCAST_IMPOSSIBLE) return null
|
||||||
val element = diagnostic.psiElement as? KtExpression ?: return null
|
val element = diagnostic.psiElement as? KtExpression ?: return null
|
||||||
@@ -182,7 +180,7 @@ object MissingIteratorExclExclFixFactory : KotlinSingleIntentionActionFactory()
|
|||||||
|
|
||||||
val descriptor = type.constructor.declarationDescriptor
|
val descriptor = type.constructor.declarationDescriptor
|
||||||
|
|
||||||
fun hasIteratorFunction(classifierDescriptor: ClassifierDescriptor?) : Boolean {
|
fun hasIteratorFunction(classifierDescriptor: ClassifierDescriptor?): Boolean {
|
||||||
if (classifierDescriptor !is ClassDescriptor) return false
|
if (classifierDescriptor !is ClassDescriptor) return false
|
||||||
|
|
||||||
val memberScope = classifierDescriptor.unsubstitutedMemberScope
|
val memberScope = classifierDescriptor.unsubstitutedMemberScope
|
||||||
|
|||||||
Reference in New Issue
Block a user