From c123cfba59b4641b1f8e4ac0a831d1522071d382 Mon Sep 17 00:00:00 2001 From: "Pavel V. Talanov" Date: Fri, 28 Mar 2014 17:27:31 +0400 Subject: [PATCH] Add isObjectLiteral() to PsiJetObjectStub --- .../jetbrains/jet/lang/psi/stubs/PsiJetObjectStub.java | 1 + .../lang/psi/stubs/elements/JetObjectElementType.java | 6 ++++-- .../jet/lang/psi/stubs/impl/PsiJetObjectStubImpl.java | 10 +++++++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/PsiJetObjectStub.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/PsiJetObjectStub.java index 8be469dff72..6547314c890 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/PsiJetObjectStub.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/PsiJetObjectStub.java @@ -21,4 +21,5 @@ import org.jetbrains.jet.lang.psi.JetObjectDeclaration; public interface PsiJetObjectStub extends PsiJetClassOrObjectStub { boolean isTopLevel(); boolean isClassObject(); + boolean isObjectLiteral(); } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/elements/JetObjectElementType.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/elements/JetObjectElementType.java index 92237a45749..30c0e91074d 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/elements/JetObjectElementType.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/elements/JetObjectElementType.java @@ -53,7 +53,7 @@ public class JetObjectElementType extends JetStubElementType superNames = PsiUtilPackage.getSuperNames(psi); return new PsiJetObjectStubImpl(parentStub, StringRef.fromString(name), fqName, Utils.instance$.wrapStrings(superNames), - psi.isTopLevel(), isClassObject(psi), JetPsiUtil.isLocal(psi)); + psi.isTopLevel(), isClassObject(psi), JetPsiUtil.isLocal(psi), psi.isObjectLiteral()); } @Override @@ -66,6 +66,7 @@ public class JetObjectElementType extends JetStubElementType superNames = stub.getSuperNames(); dataStream.writeVarInt(superNames.size()); @@ -84,6 +85,7 @@ public class JetObjectElementType extends JetStubElementType impleme private final boolean isTopLevel; private final boolean isClassObject; private final boolean isLocal; + private final boolean isObjectLiteral; public PsiJetObjectStubImpl( @NotNull StubElement parent, @@ -46,7 +47,8 @@ public class PsiJetObjectStubImpl extends StubBase impleme @NotNull StringRef[] superNames, boolean isTopLevel, boolean isClassObject, - boolean isLocal + boolean isLocal, + boolean isObjectLiteral ) { super(parent, JetStubElementTypes.OBJECT_DECLARATION); this.name = name; @@ -55,6 +57,7 @@ public class PsiJetObjectStubImpl extends StubBase impleme this.isTopLevel = isTopLevel; this.isClassObject = isClassObject; this.isLocal = isLocal; + this.isObjectLiteral = isObjectLiteral; } @Override @@ -88,6 +91,11 @@ public class PsiJetObjectStubImpl extends StubBase impleme return isClassObject; } + @Override + public boolean isObjectLiteral() { + return isObjectLiteral; + } + @Override public boolean isLocal() { return isLocal;