Allow removing trivial property accessor body when the accessor can not be fully deleted in redundant getter/setter inspections

This commit is contained in:
Ilya Kirillov
2019-05-29 13:51:08 +03:00
parent 95a6f59c62
commit 8fa9b9923f
14 changed files with 116 additions and 37 deletions
@@ -238,7 +238,7 @@ object PositioningStrategies {
is KtPropertyAccessor -> {
val endOfSignatureElement =
element.returnTypeReference
?: element.rightParenthesis?.psi
?: element.rightParenthesis
?: element.namePlaceholder
return markRange(element, endOfSignatureElement)
@@ -157,8 +157,13 @@ public class KtPropertyAccessor extends KtDeclarationStub<KotlinPropertyAccessor
}
@Nullable
public ASTNode getRightParenthesis() {
return getNode().findChildByType(KtTokens.RPAR);
public PsiElement getRightParenthesis() {
return findChildByType(KtTokens.RPAR);
}
@Nullable
public PsiElement getLeftParenthesis() {
return findChildByType(KtTokens.LPAR);
}
@Nullable