JetClassObject#getObjectDeclaration() by stub
This commit is contained in:
@@ -20,7 +20,6 @@ import com.intellij.lang.ASTNode;
|
|||||||
import com.intellij.psi.PsiElement;
|
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 org.jetbrains.jet.JetNodeTypes;
|
|
||||||
import org.jetbrains.jet.lang.psi.stubs.PsiJetPlaceHolderStub;
|
import org.jetbrains.jet.lang.psi.stubs.PsiJetPlaceHolderStub;
|
||||||
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
|
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
|
||||||
import org.jetbrains.jet.lexer.JetTokens;
|
import org.jetbrains.jet.lexer.JetTokens;
|
||||||
@@ -41,13 +40,7 @@ public class JetClassObject extends JetDeclarationStub<PsiJetPlaceHolderStub<Jet
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public JetObjectDeclaration getObjectDeclaration() {
|
public JetObjectDeclaration getObjectDeclaration() {
|
||||||
JetObjectDeclaration objectDeclaration = (JetObjectDeclaration) findChildByType(JetNodeTypes.OBJECT_DECLARATION);
|
return getRequiredStubOrPsiChild(JetStubElementTypes.OBJECT_DECLARATION);
|
||||||
|
|
||||||
assert objectDeclaration != null :
|
|
||||||
String.format("It should be impossible to produce class object element without object child:\n %s",
|
|
||||||
this.getParent().getText());
|
|
||||||
|
|
||||||
return objectDeclaration;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable @IfNotParsed
|
@Nullable @IfNotParsed
|
||||||
|
|||||||
Reference in New Issue
Block a user