Use expression body: reformat
This commit is contained in:
@@ -33,7 +33,7 @@ import org.jetbrains.kotlin.resolve.BindingContext
|
|||||||
|
|
||||||
class UseExpressionBodyInspection(private val convertEmptyToUnit: Boolean) : AbstractKotlinInspection() {
|
class UseExpressionBodyInspection(private val convertEmptyToUnit: Boolean) : AbstractKotlinInspection() {
|
||||||
|
|
||||||
constructor(): this(convertEmptyToUnit = true)
|
constructor() : this(convertEmptyToUnit = true)
|
||||||
|
|
||||||
private data class Status(val toHighlight: PsiElement?, val subject: String, val highlightType: ProblemHighlightType)
|
private data class Status(val toHighlight: PsiElement?, val subject: String, val highlightType: ProblemHighlightType)
|
||||||
|
|
||||||
@@ -46,7 +46,8 @@ class UseExpressionBodyInspection(private val convertEmptyToUnit: Boolean) : Abs
|
|||||||
val value = valueStatement.getValue()
|
val value = valueStatement.getValue()
|
||||||
if (value.anyDescendantOfType<KtReturnExpression>(
|
if (value.anyDescendantOfType<KtReturnExpression>(
|
||||||
canGoInside = { it !is KtFunctionLiteral && it !is KtNamedFunction && it !is KtPropertyAccessor }
|
canGoInside = { it !is KtFunctionLiteral && it !is KtNamedFunction && it !is KtPropertyAccessor }
|
||||||
)) return null
|
)
|
||||||
|
) return null
|
||||||
|
|
||||||
val toHighlight = valueStatement.toHighlight()
|
val toHighlight = valueStatement.toHighlight()
|
||||||
return when {
|
return when {
|
||||||
|
|||||||
Reference in New Issue
Block a user