Update JetObjectDeclaration after parser changes to parser
This commit is contained in:
@@ -86,32 +86,12 @@ public class JetObjectDeclaration extends JetNamedDeclarationStub<KotlinObjectSt
|
|||||||
return (JetObjectDeclarationName) findChildByType(JetNodeTypes.OBJECT_DECLARATION_NAME);
|
return (JetObjectDeclarationName) findChildByType(JetNodeTypes.OBJECT_DECLARATION_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@Nullable
|
|
||||||
public JetModifierList getModifierList() {
|
|
||||||
if (isClassObject()) {
|
|
||||||
PsiElement parent = getParentByStub();
|
|
||||||
assert parent instanceof JetDeclaration;
|
|
||||||
return ((JetDeclaration)parent).getModifierList();
|
|
||||||
}
|
|
||||||
return super.getModifierList();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isClassObject() {
|
public boolean isClassObject() {
|
||||||
KotlinObjectStub stub = getStub();
|
KotlinObjectStub stub = getStub();
|
||||||
if (stub != null) {
|
if (stub != null) {
|
||||||
return stub.isClassObject();
|
return stub.isClassObject();
|
||||||
}
|
}
|
||||||
PsiElement parent = getParent();
|
return getClassKeyword() != null;
|
||||||
return parent != null && parent.getNode().getElementType().equals(JetNodeTypes.CLASS_OBJECT);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
public JetClassObject getClassObjectElement() {
|
|
||||||
if (!isClassObject()) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return (JetClassObject) getParentByStub();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -188,6 +168,11 @@ public class JetObjectDeclaration extends JetNamedDeclarationStub<KotlinObjectSt
|
|||||||
return findChildByType(JetTokens.OBJECT_KEYWORD);
|
return findChildByType(JetTokens.OBJECT_KEYWORD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
public PsiElement getClassKeyword() {
|
||||||
|
return findChildByType(JetTokens.CLASS_KEYWORD);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void delete() throws IncorrectOperationException {
|
public void delete() throws IncorrectOperationException {
|
||||||
JetPsiUtil.deleteClass(this);
|
JetPsiUtil.deleteClass(this);
|
||||||
|
|||||||
Reference in New Issue
Block a user