KT-13393 related: convert reference to lambda inspection (off by default) introduced

This commit is contained in:
Mikhail Glukhikh
2016-11-24 15:24:55 +03:00
parent 9c75324188
commit 5c09e1ca98
3 changed files with 16 additions and 0 deletions
@@ -0,0 +1,5 @@
<html>
<body>
This inspection reports a function reference expression that can be replaced with lambda
</body>
</html>
+8
View File
@@ -1820,6 +1820,14 @@
language="kotlin"
/>
<localInspection implementationClass="org.jetbrains.kotlin.idea.intentions.ConvertReferenceToLambdaInspection"
displayName="Can be replaced with lambda"
groupName="Kotlin"
enabledByDefault="false"
level="INFO"
language="kotlin"
/>
<localInspection implementationClass="org.jetbrains.kotlin.idea.intentions.RemoveSetterParameterTypeInspection"
displayName="Redundant setter parameter type"
groupName="Kotlin"
@@ -22,6 +22,7 @@ import org.jetbrains.kotlin.descriptors.PropertyDescriptor
import org.jetbrains.kotlin.idea.caches.resolve.analyze
import org.jetbrains.kotlin.idea.core.KotlinNameSuggester
import org.jetbrains.kotlin.idea.core.ShortenReferences
import org.jetbrains.kotlin.idea.inspections.IntentionBasedInspection
import org.jetbrains.kotlin.idea.util.IdeDescriptorRenderers
import org.jetbrains.kotlin.psi.*
import org.jetbrains.kotlin.psi.psiUtil.startOffset
@@ -31,6 +32,8 @@ import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode
import org.jetbrains.kotlin.types.expressions.DoubleColonLHS
import org.jetbrains.kotlin.utils.singletonOrEmptyList
class ConvertReferenceToLambdaInspection : IntentionBasedInspection<KtCallableReferenceExpression>(ConvertReferenceToLambdaIntention::class)
class ConvertReferenceToLambdaIntention : SelfTargetingOffsetIndependentIntention<KtCallableReferenceExpression>(
KtCallableReferenceExpression::class.java, "Convert reference to lambda"
) {