RedundantLetInspection: fix descriptions
This commit is contained in:
@@ -2234,7 +2234,7 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<localInspection implementationClass="org.jetbrains.kotlin.idea.inspections.SimpleRedundantLetInspection"
|
<localInspection implementationClass="org.jetbrains.kotlin.idea.inspections.SimpleRedundantLetInspection"
|
||||||
displayName="Redundant `let` call"
|
displayName="Redundant receiver-based `let` call"
|
||||||
groupPath="Kotlin"
|
groupPath="Kotlin"
|
||||||
groupName="Redundant constructs"
|
groupName="Redundant constructs"
|
||||||
enabledByDefault="true"
|
enabledByDefault="true"
|
||||||
@@ -2243,7 +2243,7 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<localInspection implementationClass="org.jetbrains.kotlin.idea.inspections.ComplexRedundantLetInspection"
|
<localInspection implementationClass="org.jetbrains.kotlin.idea.inspections.ComplexRedundantLetInspection"
|
||||||
displayName="Redundant `let` call could be removed"
|
displayName="Redundant argument-based `let` call"
|
||||||
groupPath="Kotlin"
|
groupPath="Kotlin"
|
||||||
groupName="Redundant constructs"
|
groupName="Redundant constructs"
|
||||||
enabledByDefault="true"
|
enabledByDefault="true"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<html>
|
<html>
|
||||||
<body>
|
<body>
|
||||||
This inspection detects a redundant <b>let</b> when it includes only one call with lambda parameter.
|
This inspection detects a redundant argument-based <b>let</b> call.
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<html>
|
<html>
|
||||||
<body>
|
<body>
|
||||||
This inspection detects a redundant <b>let</b> when it includes only one call with lambda parameter as receiver.
|
This inspection detects a redundant receiver-based <b>let</b> call.
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ abstract class RedundantLetInspection : AbstractApplicabilityBasedInspection<KtC
|
|||||||
val lambdaExpression = element.lambdaArguments.firstOrNull()?.getLambdaExpression() ?: return false
|
val lambdaExpression = element.lambdaArguments.firstOrNull()?.getLambdaExpression() ?: return false
|
||||||
val parameterName = lambdaExpression.getParameterName() ?: return false
|
val parameterName = lambdaExpression.getParameterName() ?: return false
|
||||||
|
|
||||||
return myIsApplicable(
|
return isApplicable(
|
||||||
element,
|
element,
|
||||||
lambdaExpression.bodyExpression?.children?.singleOrNull() ?: return false,
|
lambdaExpression.bodyExpression?.children?.singleOrNull() ?: return false,
|
||||||
lambdaExpression,
|
lambdaExpression,
|
||||||
@@ -49,7 +49,7 @@ abstract class RedundantLetInspection : AbstractApplicabilityBasedInspection<KtC
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract fun myIsApplicable(
|
protected abstract fun isApplicable(
|
||||||
element: KtCallExpression,
|
element: KtCallExpression,
|
||||||
bodyExpression: PsiElement,
|
bodyExpression: PsiElement,
|
||||||
lambdaExpression: KtLambdaExpression,
|
lambdaExpression: KtLambdaExpression,
|
||||||
@@ -67,7 +67,7 @@ abstract class RedundantLetInspection : AbstractApplicabilityBasedInspection<KtC
|
|||||||
}
|
}
|
||||||
|
|
||||||
class SimpleRedundantLetInspection : RedundantLetInspection() {
|
class SimpleRedundantLetInspection : RedundantLetInspection() {
|
||||||
override fun myIsApplicable(
|
override fun isApplicable(
|
||||||
element: KtCallExpression,
|
element: KtCallExpression,
|
||||||
bodyExpression: PsiElement,
|
bodyExpression: PsiElement,
|
||||||
lambdaExpression: KtLambdaExpression,
|
lambdaExpression: KtLambdaExpression,
|
||||||
@@ -76,7 +76,7 @@ class SimpleRedundantLetInspection : RedundantLetInspection() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class ComplexRedundantLetInspection : RedundantLetInspection() {
|
class ComplexRedundantLetInspection : RedundantLetInspection() {
|
||||||
override fun myIsApplicable(
|
override fun isApplicable(
|
||||||
element: KtCallExpression,
|
element: KtCallExpression,
|
||||||
bodyExpression: PsiElement,
|
bodyExpression: PsiElement,
|
||||||
lambdaExpression: KtLambdaExpression,
|
lambdaExpression: KtLambdaExpression,
|
||||||
|
|||||||
Reference in New Issue
Block a user