Don't ruin indentation for comments inside expression declarations (KT-23295)
#KT-23295 Fixed
This commit is contained in:
@@ -29,7 +29,7 @@ import java.util.List;
|
||||
|
||||
import static org.jetbrains.kotlin.lexer.KtTokens.*;
|
||||
|
||||
public class KtDestructuringDeclaration extends KtDeclarationImpl implements KtValVarKeywordOwner {
|
||||
public class KtDestructuringDeclaration extends KtDeclarationImpl implements KtValVarKeywordOwner, KtDeclarationWithInitializer {
|
||||
public KtDestructuringDeclaration(@NotNull ASTNode node) {
|
||||
super(node);
|
||||
}
|
||||
@@ -45,6 +45,7 @@ public class KtDestructuringDeclaration extends KtDeclarationImpl implements KtV
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public KtExpression getInitializer() {
|
||||
ASTNode eqNode = getNode().findChildByType(EQ);
|
||||
if (eqNode == null) {
|
||||
@@ -53,6 +54,11 @@ public class KtDestructuringDeclaration extends KtDeclarationImpl implements KtV
|
||||
return PsiTreeUtil.getNextSiblingOfType(eqNode.getPsi(), KtExpression.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasInitializer() {
|
||||
return getInitializer() != null;
|
||||
}
|
||||
|
||||
public boolean isVar() {
|
||||
return getNode().findChildByType(KtTokens.VAR_KEYWORD) != null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user