Remove Right Part of Binary Expression Quick-Fix: Split to separate quick fixes for cast- and elvis-expressions
This commit is contained in:
@@ -201,4 +201,10 @@ fun KtParameter.dropDefaultValue() {
|
||||
val from = equalsToken ?: return
|
||||
val to = defaultValue ?: from
|
||||
deleteChildRange(from, to)
|
||||
}
|
||||
|
||||
fun dropEnclosingParenthesesIfPossible(expression: KtExpression): KtExpression {
|
||||
val parent = expression.parent as? KtParenthesizedExpression ?: return expression
|
||||
if (!KtPsiUtil.areParenthesesUseless(parent)) return expression
|
||||
return parent.replaced(expression)
|
||||
}
|
||||
Reference in New Issue
Block a user