Extension node getters
This commit is contained in:
@@ -2,6 +2,7 @@ package org.jetbrains.jet.lang.psi;
|
||||
|
||||
import com.intellij.lang.ASTNode;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.JetNodeTypes;
|
||||
|
||||
import java.util.Collections;
|
||||
@@ -15,6 +16,11 @@ public class JetExtension extends JetTypeParameterListOwner {
|
||||
super(node);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(@NotNull JetVisitor visitor) {
|
||||
visitor.visitExtension(this);
|
||||
}
|
||||
|
||||
public List<JetDeclaration> getDeclarations() {
|
||||
JetClassBody body = (JetClassBody) findChildByType(JetNodeTypes.CLASS_BODY);
|
||||
if (body == null) return Collections.emptyList();
|
||||
@@ -22,9 +28,8 @@ public class JetExtension extends JetTypeParameterListOwner {
|
||||
return body.getDeclarations();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void accept(@NotNull JetVisitor visitor) {
|
||||
visitor.visitExtension(this);
|
||||
@Nullable
|
||||
public JetTypeReference getTargetTypeRef() {
|
||||
return (JetTypeReference) findChildByType(JetNodeTypes.TYPE_REFERENCE);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user