PSI: Move getEqualsToken() method to JetDeclarationWithBody

This commit is contained in:
Alexey Sedunov
2014-12-22 14:23:24 +03:00
parent a9a30a1b7d
commit c73253259f
4 changed files with 12 additions and 1 deletions
@@ -16,16 +16,19 @@
package org.jetbrains.jet.lang.psi; package org.jetbrains.jet.lang.psi;
import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import java.util.List; import java.util.List;
public interface JetDeclarationWithBody extends JetDeclaration { public interface JetDeclarationWithBody extends JetDeclaration {
@Nullable @Nullable
JetExpression getBodyExpression(); JetExpression getBodyExpression();
@Nullable
PsiElement getEqualsToken();
@Override @Override
@Nullable @Nullable
String getName(); String getName();
@@ -52,6 +52,12 @@ public class JetFunctionLiteral extends JetFunctionNotStubbed {
return (JetBlockExpression) super.getBodyExpression(); return (JetBlockExpression) super.getBodyExpression();
} }
@Nullable
@Override
public PsiElement getEqualsToken() {
return null;
}
@NotNull @NotNull
public PsiElement getLBrace() { public PsiElement getLBrace() {
return findChildByType(JetTokens.LBRACE); return findChildByType(JetTokens.LBRACE);
@@ -77,6 +77,7 @@ public class JetNamedFunction extends JetTypeParameterListOwnerStub<KotlinFuncti
return getEqualsToken() == null; return getEqualsToken() == null;
} }
@Override
@Nullable @Nullable
public PsiElement getEqualsToken() { public PsiElement getEqualsToken() {
return findChildByType(JetTokens.EQ); return findChildByType(JetTokens.EQ);
@@ -98,6 +98,7 @@ public class JetPropertyAccessor extends JetDeclarationStub<KotlinPropertyAccess
return getBodyExpression() != null; return getBodyExpression() != null;
} }
@Override
@Nullable @Nullable
public PsiElement getEqualsToken() { public PsiElement getEqualsToken() {
return findChildByType(JetTokens.EQ); return findChildByType(JetTokens.EQ);