getInitializer moved to JetMultiDeclaration
This commit is contained in:
committed by
Andrey Breslav
parent
1ab8dc9bad
commit
1efb6512c5
@@ -21,8 +21,11 @@ import com.intellij.psi.tree.TokenSet;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.JetNodeTypes;
|
||||
import org.jetbrains.jet.lexer.JetTokens;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static org.jetbrains.jet.lexer.JetTokens.EQ;
|
||||
import static org.jetbrains.jet.lexer.JetTokens.VAL_KEYWORD;
|
||||
import static org.jetbrains.jet.lexer.JetTokens.VAR_KEYWORD;
|
||||
@@ -45,4 +48,17 @@ public class JetMultiDeclaration extends JetDeclarationImpl {
|
||||
return visitor.visitMultiDeclaration(this, data);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public List<JetMultiDeclarationEntry> getEntries() {
|
||||
return findChildrenByType(JetNodeTypes.MULTI_VARIABLE_DECLARATION_ENTRY);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public JetExpression getInitializer() {
|
||||
ASTNode eqNode = getNode().findChildByType(EQ);
|
||||
if (eqNode == null) {
|
||||
return null;
|
||||
}
|
||||
return PsiTreeUtil.getNextSiblingOfType(eqNode.getPsi(), JetExpression.class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,11 +59,7 @@ public class JetMultiDeclarationEntry extends JetNamedDeclarationNotStubbed impl
|
||||
@Nullable
|
||||
@Override
|
||||
public JetExpression getInitializer() {
|
||||
ASTNode eqNode = getParentNode().findChildByType(EQ);
|
||||
if (eqNode == null) {
|
||||
return null;
|
||||
}
|
||||
return PsiTreeUtil.getNextSiblingOfType(eqNode.getPsi(), JetExpression.class);
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
Reference in New Issue
Block a user