diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/elements/JetPlaceHolderStubElementType.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/elements/JetPlaceHolderStubElementType.java index f672b646088..a6d30936b53 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/elements/JetPlaceHolderStubElementType.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/elements/JetPlaceHolderStubElementType.java @@ -27,7 +27,7 @@ import org.jetbrains.jet.lang.psi.stubs.impl.PsiJetPlaceHolderStubImpl; import java.io.IOException; -public class JetPlaceHolderStubElementType> extends JetStubElementType, T> { +public class JetPlaceHolderStubElementType>> extends JetStubElementType, T> { public JetPlaceHolderStubElementType(@NotNull @NonNls String debugName, @NotNull Class psiClass) { super(debugName, psiClass, PsiJetPlaceHolderStub.class); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/JetStubBaseImpl.kt b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/JetStubBaseImpl.kt new file mode 100644 index 00000000000..cb475769ee3 --- /dev/null +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/JetStubBaseImpl.kt @@ -0,0 +1,81 @@ +/* + * Copyright 2010-2014 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.jet.lang.psi.stubs.impl + +import com.intellij.openapi.diagnostic.Logger +import com.intellij.psi.stubs.IStubElementType +import com.intellij.psi.stubs.NamedStub +import com.intellij.psi.stubs.StubBase +import com.intellij.psi.stubs.StubElement +import org.jetbrains.jet.lang.psi.JetElementImplStub +import org.jetbrains.jet.lang.psi.stubs.PsiJetClassOrObjectStub +import org.jetbrains.jet.lang.psi.stubs.PsiJetStubWithFqName +import java.lang.reflect.Method +import java.util.ArrayList + +public open class JetStubBaseImpl>(parent: StubElement<*>?, elementType: IStubElementType<*, *>) : StubBase(parent, elementType) { + + override fun toString(): String { + val stubInterface = this.getClass().getInterfaces().first() + val propertiesValues = renderPropertyValues(stubInterface) + if (propertiesValues.isEmpty()) { + return "" + } + return propertiesValues.makeString(separator = ", ", prefix = "[", postfix = "]") + } + + private fun renderPropertyValues(stubInterface: Class): List { + return collectProperties(stubInterface).map { property -> renderProperty(property) }.filterNotNull().sort() + } + + private fun collectProperties(stubInterface: Class<*>): Collection { + val result = ArrayList() + result.addAll(stubInterface.getDeclaredMethods().filter { it.getParameterTypes()!!.isEmpty() }) + for (baseInterface in stubInterface.getInterfaces()) { + if (baseInterface in BASE_STUB_INTERFACES) { + result.addAll(collectProperties(baseInterface)) + } + } + return result + } + + private fun renderProperty(property: Method): String? { + return try { + val value = property.invoke(this) + val name = getPropertyName(property) + "$name=$value" + } + catch (e: Exception) { + LOGGER.error(e) + null + } + } + + private fun getPropertyName(method: Method): String { + val methodName = method.getName()!! + if (methodName.startsWith("get")) { + return methodName.substring(3).decapitalize() + } + return methodName + } + + class object { + private val LOGGER: Logger = Logger.getInstance(javaClass>>()) + + private val BASE_STUB_INTERFACES = listOf(javaClass>(), javaClass>(), javaClass>()) + } +} diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetAnnotationEntryStubImpl.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetAnnotationEntryStubImpl.java index 506c0cd980a..ad5bebaae5c 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetAnnotationEntryStubImpl.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetAnnotationEntryStubImpl.java @@ -16,7 +16,6 @@ package org.jetbrains.jet.lang.psi.stubs.impl; -import com.intellij.psi.stubs.StubBase; import com.intellij.psi.stubs.StubElement; import com.intellij.util.io.StringRef; import org.jetbrains.annotations.NotNull; @@ -24,7 +23,7 @@ import org.jetbrains.jet.lang.psi.JetAnnotationEntry; import org.jetbrains.jet.lang.psi.stubs.PsiJetAnnotationEntryStub; import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes; -public class PsiJetAnnotationEntryStubImpl extends StubBase implements PsiJetAnnotationEntryStub { +public class PsiJetAnnotationEntryStubImpl extends JetStubBaseImpl implements PsiJetAnnotationEntryStub { private final StringRef shortName; private final boolean hasValueArguments; @@ -44,13 +43,4 @@ public class PsiJetAnnotationEntryStubImpl extends StubBase public boolean hasValueArguments() { return hasValueArguments; } - - @Override - public String toString() { - StringBuilder builder = new StringBuilder(); - builder.append("PsiJetAnnotationEntryStubImpl["); - builder.append("shortName=").append(getShortName()); - builder.append("]"); - return builder.toString(); - } } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetClassStubImpl.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetClassStubImpl.java index be30813392b..f236a45f13f 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetClassStubImpl.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetClassStubImpl.java @@ -16,10 +16,7 @@ package org.jetbrains.jet.lang.psi.stubs.impl; -import com.intellij.openapi.util.text.StringUtil; -import com.intellij.psi.stubs.StubBase; import com.intellij.psi.stubs.StubElement; -import com.intellij.util.ArrayUtil; import com.intellij.util.io.StringRef; import org.jetbrains.annotations.NotNull; import org.jetbrains.jet.lang.psi.JetClass; @@ -30,7 +27,7 @@ import org.jetbrains.jet.lang.resolve.name.FqName; import java.util.ArrayList; import java.util.List; -public class PsiJetClassStubImpl extends StubBase implements PsiJetClassStub { +public class PsiJetClassStubImpl extends JetStubBaseImpl implements PsiJetClassStub { private final StringRef qualifiedName; private final StringRef name; private final StringRef[] superNames; @@ -103,30 +100,4 @@ public class PsiJetClassStubImpl extends StubBase implements PsiJetCla public boolean isTopLevel() { return isTopLevel; } - - @Override - public String toString() { - StringBuilder builder = new StringBuilder(); - builder.append("PsiJetClassStubImpl["); - - if (isEnumEntry()) { - builder.append("enumEntry "); - } - - if (isTrait()) { - builder.append("trait "); - } - - if (isLocal()) { - builder.append("local "); - } - - builder.append("name=").append(getName()); - builder.append(" fqn=").append(getFqName()); - builder.append(" superNames=").append("[").append(StringUtil.join(ArrayUtil.toStringArray(getSuperNames()))).append("]"); - - builder.append("]"); - - return builder.toString(); - } } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetFunctionStubImpl.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetFunctionStubImpl.java index 687b22b8a3e..be370d0431e 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetFunctionStubImpl.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetFunctionStubImpl.java @@ -16,7 +16,6 @@ package org.jetbrains.jet.lang.psi.stubs.impl; -import com.intellij.psi.stubs.StubBase; import com.intellij.psi.stubs.StubElement; import com.intellij.util.io.StringRef; import org.jetbrains.annotations.NotNull; @@ -26,7 +25,7 @@ import org.jetbrains.jet.lang.psi.stubs.PsiJetFunctionStub; import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes; import org.jetbrains.jet.lang.resolve.name.FqName; -public class PsiJetFunctionStubImpl extends StubBase implements PsiJetFunctionStub { +public class PsiJetFunctionStubImpl extends JetStubBaseImpl implements PsiJetFunctionStub { private final StringRef nameRef; private final boolean isTopLevel; @@ -91,31 +90,6 @@ public class PsiJetFunctionStubImpl extends StubBase implement return hasTypeParameterListBeforeFunctionName; } - @Override - public String toString() { - StringBuilder builder = new StringBuilder(); - builder.append("PsiJetFunctionStubImpl["); - - if (isTopLevel()) { - assert fqName != null; - builder.append("top ").append("fqName=").append(fqName.toString()).append(" "); - } - - if (isExtension()) { - builder.append("ext "); - } - - if (!hasBlockBody) { - builder.append("no block body "); - } - - builder.append("name=").append(getName()); - - builder.append("]"); - - return builder.toString(); - } - @Nullable @Override public FqName getFqName() { diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetImportDirectiveStubImpl.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetImportDirectiveStubImpl.java index e46611b5ecd..94894b75d9b 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetImportDirectiveStubImpl.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetImportDirectiveStubImpl.java @@ -16,7 +16,6 @@ package org.jetbrains.jet.lang.psi.stubs.impl; -import com.intellij.psi.stubs.StubBase; import com.intellij.psi.stubs.StubElement; import com.intellij.util.io.StringRef; import org.jetbrains.annotations.Nullable; @@ -24,7 +23,7 @@ import org.jetbrains.jet.lang.psi.JetImportDirective; import org.jetbrains.jet.lang.psi.stubs.PsiJetImportDirectiveStub; import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes; -public class PsiJetImportDirectiveStubImpl extends StubBase implements PsiJetImportDirectiveStub { +public class PsiJetImportDirectiveStubImpl extends JetStubBaseImpl implements PsiJetImportDirectiveStub { private final boolean isAbsoluteInRootPackage; private final boolean isAllUnder; @Nullable diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetModifierListStubImpl.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetModifierListStubImpl.java index 4187144f43a..089a9f88e6c 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetModifierListStubImpl.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetModifierListStubImpl.java @@ -16,7 +16,6 @@ package org.jetbrains.jet.lang.psi.stubs.impl; -import com.intellij.psi.stubs.StubBase; import com.intellij.psi.stubs.StubElement; import com.intellij.util.ArrayUtil; import org.jetbrains.annotations.NotNull; @@ -27,7 +26,7 @@ import org.jetbrains.jet.lexer.JetModifierKeywordToken; import static org.jetbrains.jet.lexer.JetTokens.MODIFIER_KEYWORDS_ARRAY; -public class PsiJetModifierListStubImpl extends StubBase implements PsiJetModifierListStub { +public class PsiJetModifierListStubImpl extends JetStubBaseImpl implements PsiJetModifierListStub { static { assert MODIFIER_KEYWORDS_ARRAY.length <= 32 : "Current implementation depends on the ability to represent modifier list as bit mask"; @@ -68,9 +67,14 @@ public class PsiJetModifierListStubImpl extends StubBase implem StringBuilder sb = new StringBuilder(); sb.append(super.toString()); sb.append("["); + boolean first = true; for (JetModifierKeywordToken modifierKeyword : MODIFIER_KEYWORDS_ARRAY) { if (hasModifier(modifierKeyword)) { - sb.append(modifierKeyword.getValue()).append(" "); + if (!first) { + sb.append(" "); + } + sb.append(modifierKeyword.getValue()); + first = false; } } sb.append("]"); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetNameReferenceExpressionStubImpl.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetNameReferenceExpressionStubImpl.java index 8e161df8743..7e6c6ea79cb 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetNameReferenceExpressionStubImpl.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetNameReferenceExpressionStubImpl.java @@ -16,7 +16,6 @@ package org.jetbrains.jet.lang.psi.stubs.impl; -import com.intellij.psi.stubs.StubBase; import com.intellij.psi.stubs.StubElement; import com.intellij.util.io.StringRef; import org.jetbrains.annotations.NotNull; @@ -24,7 +23,7 @@ import org.jetbrains.jet.lang.psi.JetNameReferenceExpression; import org.jetbrains.jet.lang.psi.stubs.PsiJetNameReferenceExpressionStub; import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes; -public class PsiJetNameReferenceExpressionStubImpl extends StubBase implements PsiJetNameReferenceExpressionStub { +public class PsiJetNameReferenceExpressionStubImpl extends JetStubBaseImpl implements PsiJetNameReferenceExpressionStub { @NotNull private final StringRef referencedName; diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetObjectStubImpl.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetObjectStubImpl.java index c90d5e7a600..272cc3dc70f 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetObjectStubImpl.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetObjectStubImpl.java @@ -16,10 +16,7 @@ package org.jetbrains.jet.lang.psi.stubs.impl; -import com.intellij.openapi.util.text.StringUtil; -import com.intellij.psi.stubs.StubBase; import com.intellij.psi.stubs.StubElement; -import com.intellij.util.ArrayUtil; import com.intellij.util.io.StringRef; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -31,7 +28,7 @@ import org.jetbrains.jet.lang.resolve.name.FqName; import java.util.ArrayList; import java.util.List; -public class PsiJetObjectStubImpl extends StubBase implements PsiJetObjectStub { +public class PsiJetObjectStubImpl extends JetStubBaseImpl implements PsiJetObjectStub { private final StringRef name; private final FqName fqName; private final StringRef[] superNames; @@ -100,30 +97,4 @@ public class PsiJetObjectStubImpl extends StubBase impleme public boolean isLocal() { return isLocal; } - - @Override - public String toString() { - StringBuilder builder = new StringBuilder(); - - builder.append("PsiJetObjectStubImpl["); - - if (isClassObject) { - builder.append("class-object "); - } - - if (isTopLevel) { - builder.append("top "); - } - - if (isLocal()) { - builder.append("local "); - } - - builder.append("name=").append(getName()); - builder.append(" fqName=").append(fqName != null ? fqName.toString() : "null"); - builder.append(" superNames=").append("[").append(StringUtil.join(ArrayUtil.toStringArray(getSuperNames()))).append("]"); - builder.append("]"); - - return builder.toString(); - } } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetParameterStubImpl.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetParameterStubImpl.java index c8ddefbf1ea..0f26565c139 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetParameterStubImpl.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetParameterStubImpl.java @@ -16,7 +16,6 @@ package org.jetbrains.jet.lang.psi.stubs.impl; -import com.intellij.psi.stubs.StubBase; import com.intellij.psi.stubs.StubElement; import com.intellij.util.io.StringRef; import org.jetbrains.annotations.Nullable; @@ -25,7 +24,7 @@ import org.jetbrains.jet.lang.psi.stubs.PsiJetParameterStub; import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes; import org.jetbrains.jet.lang.resolve.name.FqName; -public class PsiJetParameterStubImpl extends StubBase implements PsiJetParameterStub { +public class PsiJetParameterStubImpl extends JetStubBaseImpl implements PsiJetParameterStub { private final StringRef name; private final boolean isMutable; private final StringRef fqName; @@ -67,23 +66,6 @@ public class PsiJetParameterStubImpl extends StubBase implements P return hasDefaultValue; } - @Override - public String toString() { - StringBuilder builder = new StringBuilder(); - builder.append("PsiJetParameterStubImpl["); - - builder.append(isMutable() ? "var " : "val "); - - builder.append("name=").append(getName()); - if (fqName != null) { - builder.append(" fqName=").append(fqName.toString()).append(" "); - } - - builder.append("]"); - - return builder.toString(); - } - @Nullable @Override public FqName getFqName() { diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetPlaceHolderStubImpl.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetPlaceHolderStubImpl.java index 5b61bc59081..6eeca76e0ce 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetPlaceHolderStubImpl.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetPlaceHolderStubImpl.java @@ -17,13 +17,14 @@ package org.jetbrains.jet.lang.psi.stubs.impl; import com.intellij.psi.stubs.IStubElementType; -import com.intellij.psi.stubs.StubBase; import com.intellij.psi.stubs.StubElement; -import org.jetbrains.jet.lang.psi.JetElement; +import org.jetbrains.jet.lang.psi.JetElementImplStub; import org.jetbrains.jet.lang.psi.stubs.PsiJetPlaceHolderStub; -public class PsiJetPlaceHolderStubImpl extends StubBase implements PsiJetPlaceHolderStub { +public class PsiJetPlaceHolderStubImpl>> extends JetStubBaseImpl + implements PsiJetPlaceHolderStub { public PsiJetPlaceHolderStubImpl(StubElement parent, IStubElementType elementType) { + //noinspection unchecked super(parent, elementType); } } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetPropertyAccessorStubImpl.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetPropertyAccessorStubImpl.java index 22b46a7edd0..ae32a213e84 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetPropertyAccessorStubImpl.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetPropertyAccessorStubImpl.java @@ -16,13 +16,12 @@ package org.jetbrains.jet.lang.psi.stubs.impl; -import com.intellij.psi.stubs.StubBase; import com.intellij.psi.stubs.StubElement; import org.jetbrains.jet.lang.psi.JetPropertyAccessor; import org.jetbrains.jet.lang.psi.stubs.PsiJetPropertyAccessorStub; import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes; -public class PsiJetPropertyAccessorStubImpl extends StubBase implements PsiJetPropertyAccessorStub { +public class PsiJetPropertyAccessorStubImpl extends JetStubBaseImpl implements PsiJetPropertyAccessorStub { private final boolean isGetter; private final boolean hasBody; private final boolean hasBlockBody; diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetPropertyStubImpl.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetPropertyStubImpl.java index c921a03f8ea..ada054acb85 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetPropertyStubImpl.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetPropertyStubImpl.java @@ -16,7 +16,6 @@ package org.jetbrains.jet.lang.psi.stubs.impl; -import com.intellij.psi.stubs.StubBase; import com.intellij.psi.stubs.StubElement; import com.intellij.util.io.StringRef; import org.jetbrains.annotations.Nullable; @@ -25,7 +24,7 @@ import org.jetbrains.jet.lang.psi.stubs.PsiJetPropertyStub; import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes; import org.jetbrains.jet.lang.resolve.name.FqName; -public class PsiJetPropertyStubImpl extends StubBase implements PsiJetPropertyStub { +public class PsiJetPropertyStubImpl extends JetStubBaseImpl implements PsiJetPropertyStub { private final StringRef name; private final boolean isVar; private final boolean isTopLevel; @@ -113,24 +112,4 @@ public class PsiJetPropertyStubImpl extends StubBase implements Psi public String getName() { return StringRef.toString(name); } - - @Override - public String toString() { - StringBuilder builder = new StringBuilder(); - - builder.append("PsiJetPropertyStubImpl["); - - builder.append(isVar() ? "var " : "val "); - - if (isTopLevel()) { - assert fqName != null; - builder.append("top ").append("fqName=").append(fqName.toString()).append(" "); - } - - builder.append("name=").append(getName()); - - builder.append("]"); - - return builder.toString(); - } } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetTypeConstraintImpl.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetTypeConstraintImpl.java index ece3e5b3ad0..3214c5c93a9 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetTypeConstraintImpl.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetTypeConstraintImpl.java @@ -16,13 +16,12 @@ package org.jetbrains.jet.lang.psi.stubs.impl; -import com.intellij.psi.stubs.StubBase; import com.intellij.psi.stubs.StubElement; import org.jetbrains.jet.lang.psi.JetTypeConstraint; import org.jetbrains.jet.lang.psi.stubs.PsiJetTypeConstraintStub; import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes; -public class PsiJetTypeConstraintImpl extends StubBase implements PsiJetTypeConstraintStub { +public class PsiJetTypeConstraintImpl extends JetStubBaseImpl implements PsiJetTypeConstraintStub { private final boolean isClassObjectConstraint; public PsiJetTypeConstraintImpl(StubElement parent, boolean isClassObjectConstraint) { diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetTypeParameterStubImpl.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetTypeParameterStubImpl.java index bf709f873c9..51d6a7792c1 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetTypeParameterStubImpl.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetTypeParameterStubImpl.java @@ -16,7 +16,6 @@ package org.jetbrains.jet.lang.psi.stubs.impl; -import com.intellij.psi.stubs.StubBase; import com.intellij.psi.stubs.StubElement; import com.intellij.util.io.StringRef; import org.jetbrains.annotations.Nullable; @@ -25,7 +24,7 @@ import org.jetbrains.jet.lang.psi.stubs.PsiJetTypeParameterStub; import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes; import org.jetbrains.jet.lang.resolve.name.FqName; -public class PsiJetTypeParameterStubImpl extends StubBase implements PsiJetTypeParameterStub { +public class PsiJetTypeParameterStubImpl extends JetStubBaseImpl implements PsiJetTypeParameterStub { private final StringRef name; private final boolean isInVariance; private final boolean isOutVariance; @@ -53,25 +52,6 @@ public class PsiJetTypeParameterStubImpl extends StubBase impl return StringRef.toString(name); } - @Override - public String toString() { - StringBuilder builder = new StringBuilder(); - builder.append("PsiJetTypeParameterStubImpl["); - - if (isInVariance()) { - builder.append("in "); - } - - if (isOutVariance()) { - builder.append("out "); - } - - builder.append("name=").append(getName()); - builder.append("]"); - - return builder.toString(); - } - @Nullable @Override public FqName getFqName() { diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetTypeProjectionStubImpl.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetTypeProjectionStubImpl.java index 3cd51bffee3..070788b28b4 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetTypeProjectionStubImpl.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetTypeProjectionStubImpl.java @@ -16,14 +16,13 @@ package org.jetbrains.jet.lang.psi.stubs.impl; -import com.intellij.psi.stubs.StubBase; import com.intellij.psi.stubs.StubElement; import org.jetbrains.jet.lang.psi.JetProjectionKind; import org.jetbrains.jet.lang.psi.JetTypeProjection; import org.jetbrains.jet.lang.psi.stubs.PsiJetTypeProjectionStub; import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes; -public class PsiJetTypeProjectionStubImpl extends StubBase implements PsiJetTypeProjectionStub { +public class PsiJetTypeProjectionStubImpl extends JetStubBaseImpl implements PsiJetTypeProjectionStub { private final int projectionKindOrdinal; diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetUserTypeStubImpl.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetUserTypeStubImpl.java index 6ce6494daea..df7924fb09c 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetUserTypeStubImpl.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetUserTypeStubImpl.java @@ -16,15 +16,12 @@ package org.jetbrains.jet.lang.psi.stubs.impl; -import com.intellij.psi.stubs.StubBase; import com.intellij.psi.stubs.StubElement; -import org.jetbrains.annotations.NotNull; import org.jetbrains.jet.lang.psi.JetUserType; import org.jetbrains.jet.lang.psi.stubs.PsiJetUserTypeStub; import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes; -import org.jetbrains.jet.lang.resolve.name.Name; -public class PsiJetUserTypeStubImpl extends StubBase implements PsiJetUserTypeStub { +public class PsiJetUserTypeStubImpl extends JetStubBaseImpl implements PsiJetUserTypeStub { private final boolean isAbsoluteInRootPackage; public PsiJetUserTypeStubImpl(StubElement parent, boolean isAbsoluteInRootPackage) { diff --git a/idea/testData/stubs/AnnotationClass.expected b/idea/testData/stubs/AnnotationClass.expected index c75aedb372c..1ab18625aed 100644 --- a/idea/testData/stubs/AnnotationClass.expected +++ b/idea/testData/stubs/AnnotationClass.expected @@ -1,2 +1,4 @@ PsiJetFileStubImpl[package=] - CLASS:PsiJetClassStubImpl[isAnnotation name=Test fqn=Test superNames=[]] + PACKAGE_DIRECTIVE: + CLASS:[fqName=Test, isEnumEntry=false, isLocal=false, isTopLevel=true, isTrait=false, name=Test, superNames=[]] + MODIFIER_LIST:[annotation] diff --git a/idea/testData/stubs/AnnotationOnClass.expected b/idea/testData/stubs/AnnotationOnClass.expected index b102e187568..5b9f0bf5391 100644 --- a/idea/testData/stubs/AnnotationOnClass.expected +++ b/idea/testData/stubs/AnnotationOnClass.expected @@ -1,4 +1,10 @@ PsiJetFileStubImpl[package=] - CLASS:PsiJetClassStubImpl[name=Test fqn=Test superNames=[]] - ANNOTATION_ENTRY:PsiJetAnnotationStubImpl[shortName=Deprecated] - CLASS_BODY:PsiJetClassBodyStubImpl + PACKAGE_DIRECTIVE: + CLASS:[fqName=Test, isEnumEntry=false, isLocal=false, isTopLevel=true, isTrait=false, name=Test, superNames=[]] + MODIFIER_LIST:[] + ANNOTATION_ENTRY:[hasValueArguments=false, shortName=Deprecated] + CONSTRUCTOR_CALLEE: + TYPE_REFERENCE: + USER_TYPE:[isAbsoluteInRootPackage=false] + REFERENCE_EXPRESSION:[referencedName=Deprecated] + CLASS_BODY: diff --git a/idea/testData/stubs/AnnotationOnFunction.expected b/idea/testData/stubs/AnnotationOnFunction.expected index a609e45c639..ed648f8133e 100644 --- a/idea/testData/stubs/AnnotationOnFunction.expected +++ b/idea/testData/stubs/AnnotationOnFunction.expected @@ -1,4 +1,10 @@ PsiJetFileStubImpl[package=] - FUN:PsiJetFunctionStubImpl[top fqName=foo name=foo] - ANNOTATION_ENTRY:PsiJetAnnotationStubImpl[shortName=Deprecated] - VALUE_PARAMETER_LIST + PACKAGE_DIRECTIVE: + FUN:[fqName=foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, name=foo] + MODIFIER_LIST:[] + ANNOTATION_ENTRY:[hasValueArguments=false, shortName=Deprecated] + CONSTRUCTOR_CALLEE: + TYPE_REFERENCE: + USER_TYPE:[isAbsoluteInRootPackage=false] + REFERENCE_EXPRESSION:[referencedName=Deprecated] + VALUE_PARAMETER_LIST: diff --git a/idea/testData/stubs/AnnotationOnLocalFunction.expected b/idea/testData/stubs/AnnotationOnLocalFunction.expected index 9cf4c501b68..489d6a4d6a3 100644 --- a/idea/testData/stubs/AnnotationOnLocalFunction.expected +++ b/idea/testData/stubs/AnnotationOnLocalFunction.expected @@ -1,3 +1,4 @@ PsiJetFileStubImpl[package=] - FUN:PsiJetFunctionStubImpl[top fqName=foo name=foo] - VALUE_PARAMETER_LIST + PACKAGE_DIRECTIVE: + FUN:[fqName=foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, name=foo] + VALUE_PARAMETER_LIST: diff --git a/idea/testData/stubs/AnonymousObject.expected b/idea/testData/stubs/AnonymousObject.expected index cbb2982c9e2..185c8798bc8 100644 --- a/idea/testData/stubs/AnonymousObject.expected +++ b/idea/testData/stubs/AnonymousObject.expected @@ -1,5 +1,6 @@ PsiJetFileStubImpl[package=] - CLASS:PsiJetClassStubImpl[name=A fqn=A superNames=[]] - CLASS:PsiJetClassStubImpl[trait name=T fqn=T superNames=[]] - PROPERTY:PsiJetPropertyStubImpl[val top fqName=obj name=obj typeText=null bodyText=object : A(), T] - OBJECT_DECLARATION:PsiJetObjectStubImpl[local name=null fqName=null superNames=[AT]] + PACKAGE_DIRECTIVE: + CLASS:[fqName=A, isEnumEntry=false, isLocal=false, isTopLevel=true, isTrait=false, name=A, superNames=[]] + CLASS:[fqName=T, isEnumEntry=false, isLocal=false, isTopLevel=true, isTrait=true, name=T, superNames=[]] + PROPERTY:[fqName=obj, hasDelegate=false, hasDelegateExpression=false, hasInitializer=true, hasReceiverTypeRef=false, hasReturnTypeRef=false, isTopLevel=true, isVar=false, name=obj] + OBJECT_DECLARATION:[fqName=null, isClassObject=false, isLocal=true, isObjectLiteral=true, isTopLevel=false, name=null, superNames=[A, T]] diff --git a/idea/testData/stubs/ClassObject.expected b/idea/testData/stubs/ClassObject.expected index 03c62e691b3..f71d2b92089 100644 --- a/idea/testData/stubs/ClassObject.expected +++ b/idea/testData/stubs/ClassObject.expected @@ -1,7 +1,9 @@ PsiJetFileStubImpl[package=] - CLASS:PsiJetClassStubImpl[name=C fqn=C superNames=[]] - CLASS_BODY - OBJECT_DECLARATION:PsiJetObjectStubImpl[class-object name=null fqName=null superNames=[]] - CLASS_BODY - FUN:PsiJetFunctionStubImpl[name=foo] - VALUE_PARAMETER_LIST + PACKAGE_DIRECTIVE: + CLASS:[fqName=C, isEnumEntry=false, isLocal=false, isTopLevel=true, isTrait=false, name=C, superNames=[]] + CLASS_BODY: + CLASS_OBJECT: + OBJECT_DECLARATION:[fqName=null, isClassObject=true, isLocal=false, isObjectLiteral=false, isTopLevel=false, name=null, superNames=[]] + CLASS_BODY: + FUN:[fqName=C.foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=foo] + VALUE_PARAMETER_LIST: diff --git a/idea/testData/stubs/ClassProperty.expected b/idea/testData/stubs/ClassProperty.expected index 8252a2ad9c5..85fc27805b3 100644 --- a/idea/testData/stubs/ClassProperty.expected +++ b/idea/testData/stubs/ClassProperty.expected @@ -1,4 +1,9 @@ PsiJetFileStubImpl[package=] - CLASS:PsiJetClassStubImpl[name=More fqn=More superNames=[]] - CLASS_BODY - PROPERTY:PsiJetPropertyStubImpl[val name=test typeText=Int bodyText=11] + PACKAGE_DIRECTIVE: + CLASS:[fqName=More, isEnumEntry=false, isLocal=false, isTopLevel=true, isTrait=false, name=More, superNames=[]] + CLASS_BODY: + PROPERTY:[fqName=More.test, hasDelegate=false, hasDelegateExpression=false, hasInitializer=true, hasReceiverTypeRef=false, hasReturnTypeRef=true, isTopLevel=false, isVar=false, name=test] + MODIFIER_LIST:[private] + TYPE_REFERENCE: + USER_TYPE:[isAbsoluteInRootPackage=false] + REFERENCE_EXPRESSION:[referencedName=Int] diff --git a/idea/testData/stubs/ClassTypeParameters.expected b/idea/testData/stubs/ClassTypeParameters.expected index 6531c22387e..6aa01faefd2 100644 --- a/idea/testData/stubs/ClassTypeParameters.expected +++ b/idea/testData/stubs/ClassTypeParameters.expected @@ -1,5 +1,6 @@ PsiJetFileStubImpl[package=] - CLASS:PsiJetClassStubImpl[name=C fqn=C superNames=[]] - TYPE_PARAMETER_LIST - TYPE_PARAMETER:PsiJetTypeParameterStubImpl[name=T extendText=null] - CLASS_BODY + PACKAGE_DIRECTIVE: + CLASS:[fqName=C, isEnumEntry=false, isLocal=false, isTopLevel=true, isTrait=false, name=C, superNames=[]] + TYPE_PARAMETER_LIST: + TYPE_PARAMETER:[fqName=null, isInVariance=false, isOutVariance=false, name=T] + CLASS_BODY: diff --git a/idea/testData/stubs/FilePackage.expected b/idea/testData/stubs/FilePackage.expected index 521cfeefc45..5f97fba7b06 100644 --- a/idea/testData/stubs/FilePackage.expected +++ b/idea/testData/stubs/FilePackage.expected @@ -1 +1,5 @@ PsiJetFileStubImpl[package=some.test] + PACKAGE_DIRECTIVE: + DOT_QUALIFIED_EXPRESSION: + REFERENCE_EXPRESSION:[referencedName=some] + REFERENCE_EXPRESSION:[referencedName=test] diff --git a/idea/testData/stubs/FunctionInNotNamedObject.expected b/idea/testData/stubs/FunctionInNotNamedObject.expected index f6ec362ef64..a1672c85775 100644 --- a/idea/testData/stubs/FunctionInNotNamedObject.expected +++ b/idea/testData/stubs/FunctionInNotNamedObject.expected @@ -1,5 +1,6 @@ PsiJetFileStubImpl[package=] - OBJECT_DECLARATION:PsiJetObjectStubImpl[top name=null fqName= superNames=[]] - CLASS_BODY - FUN:PsiJetFunctionStubImpl[name=testing] - VALUE_PARAMETER_LIST + PACKAGE_DIRECTIVE: + OBJECT_DECLARATION:[fqName=, isClassObject=false, isLocal=false, isObjectLiteral=false, isTopLevel=true, name=null, superNames=[]] + CLASS_BODY: + FUN:[fqName=null, hasBlockBody=false, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=testing] + VALUE_PARAMETER_LIST: diff --git a/idea/testData/stubs/FunctionParameters.expected b/idea/testData/stubs/FunctionParameters.expected index f1a1ed69284..446b4b05062 100644 --- a/idea/testData/stubs/FunctionParameters.expected +++ b/idea/testData/stubs/FunctionParameters.expected @@ -1,5 +1,12 @@ PsiJetFileStubImpl[package=] - FUN:PsiJetFunctionStubImpl[top fqName=some name=some] - VALUE_PARAMETER_LIST - VALUE_PARAMETER:PsiJetParameterStubImpl[val name=t typeText=Int defaultValue=null] - VALUE_PARAMETER:PsiJetParameterStubImpl[val name=other typeText=String defaultValue="hello"] + PACKAGE_DIRECTIVE: + FUN:[fqName=some, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, name=some] + VALUE_PARAMETER_LIST: + VALUE_PARAMETER:[fqName=null, hasDefaultValue=false, hasValOrValNode=false, isMutable=false, name=t] + TYPE_REFERENCE: + USER_TYPE:[isAbsoluteInRootPackage=false] + REFERENCE_EXPRESSION:[referencedName=Int] + VALUE_PARAMETER:[fqName=null, hasDefaultValue=true, hasValOrValNode=false, isMutable=false, name=other] + TYPE_REFERENCE: + USER_TYPE:[isAbsoluteInRootPackage=false] + REFERENCE_EXPRESSION:[referencedName=String] diff --git a/idea/testData/stubs/InnerClass.expected b/idea/testData/stubs/InnerClass.expected index f8e30546d8c..d51ec800611 100644 --- a/idea/testData/stubs/InnerClass.expected +++ b/idea/testData/stubs/InnerClass.expected @@ -1,5 +1,7 @@ PsiJetFileStubImpl[package=] - CLASS:PsiJetClassStubImpl[name=A fqn=A superNames=[]] - CLASS_BODY - CLASS:PsiJetClassStubImpl[inner name=B fqn=A.B superNames=[]] - CLASS_BODY + PACKAGE_DIRECTIVE: + CLASS:[fqName=A, isEnumEntry=false, isLocal=false, isTopLevel=true, isTrait=false, name=A, superNames=[]] + CLASS_BODY: + CLASS:[fqName=A.B, isEnumEntry=false, isLocal=false, isTopLevel=false, isTrait=false, name=B, superNames=[]] + MODIFIER_LIST:[inner] + CLASS_BODY: diff --git a/idea/testData/stubs/LocalClass.expected b/idea/testData/stubs/LocalClass.expected index 4aa7a09c53a..733034f1e09 100644 --- a/idea/testData/stubs/LocalClass.expected +++ b/idea/testData/stubs/LocalClass.expected @@ -1,6 +1,7 @@ PsiJetFileStubImpl[package=] - CLASS:PsiJetClassStubImpl[name=A fqn=A superNames=[]] - CLASS:PsiJetClassStubImpl[trait name=T fqn=T superNames=[]] - FUN:PsiJetFunctionStubImpl[top fqName=foo name=foo] - VALUE_PARAMETER_LIST - CLASS:PsiJetClassStubImpl[local name=Test fqn=null superNames=[AT]] + PACKAGE_DIRECTIVE: + CLASS:[fqName=A, isEnumEntry=false, isLocal=false, isTopLevel=true, isTrait=false, name=A, superNames=[]] + CLASS:[fqName=T, isEnumEntry=false, isLocal=false, isTopLevel=true, isTrait=true, name=T, superNames=[]] + FUN:[fqName=foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, name=foo] + VALUE_PARAMETER_LIST: + CLASS:[fqName=null, isEnumEntry=false, isLocal=true, isTopLevel=false, isTrait=false, name=Test, superNames=[A, T]] diff --git a/idea/testData/stubs/LocalClassInLocalFunction.expected b/idea/testData/stubs/LocalClassInLocalFunction.expected index 4aa7a09c53a..733034f1e09 100644 --- a/idea/testData/stubs/LocalClassInLocalFunction.expected +++ b/idea/testData/stubs/LocalClassInLocalFunction.expected @@ -1,6 +1,7 @@ PsiJetFileStubImpl[package=] - CLASS:PsiJetClassStubImpl[name=A fqn=A superNames=[]] - CLASS:PsiJetClassStubImpl[trait name=T fqn=T superNames=[]] - FUN:PsiJetFunctionStubImpl[top fqName=foo name=foo] - VALUE_PARAMETER_LIST - CLASS:PsiJetClassStubImpl[local name=Test fqn=null superNames=[AT]] + PACKAGE_DIRECTIVE: + CLASS:[fqName=A, isEnumEntry=false, isLocal=false, isTopLevel=true, isTrait=false, name=A, superNames=[]] + CLASS:[fqName=T, isEnumEntry=false, isLocal=false, isTopLevel=true, isTrait=true, name=T, superNames=[]] + FUN:[fqName=foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, name=foo] + VALUE_PARAMETER_LIST: + CLASS:[fqName=null, isEnumEntry=false, isLocal=true, isTopLevel=false, isTrait=false, name=Test, superNames=[A, T]] diff --git a/idea/testData/stubs/LocalNamedObject.expected b/idea/testData/stubs/LocalNamedObject.expected index ad55ff9fbff..f46fb1494be 100644 --- a/idea/testData/stubs/LocalNamedObject.expected +++ b/idea/testData/stubs/LocalNamedObject.expected @@ -1,6 +1,7 @@ PsiJetFileStubImpl[package=] - CLASS:PsiJetClassStubImpl[name=A fqn=A superNames=[]] - CLASS:PsiJetClassStubImpl[trait name=T fqn=T superNames=[]] - FUN:PsiJetFunctionStubImpl[top fqName=foo name=foo] - VALUE_PARAMETER_LIST - OBJECT_DECLARATION:PsiJetObjectStubImpl[local name=O fqName=null superNames=[AT]] + PACKAGE_DIRECTIVE: + CLASS:[fqName=A, isEnumEntry=false, isLocal=false, isTopLevel=true, isTrait=false, name=A, superNames=[]] + CLASS:[fqName=T, isEnumEntry=false, isLocal=false, isTopLevel=true, isTrait=true, name=T, superNames=[]] + FUN:[fqName=foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, name=foo] + VALUE_PARAMETER_LIST: + OBJECT_DECLARATION:[fqName=null, isClassObject=false, isLocal=true, isObjectLiteral=false, isTopLevel=false, name=O, superNames=[A, T]] diff --git a/idea/testData/stubs/ManyAnnotationsOnFunction.expected b/idea/testData/stubs/ManyAnnotationsOnFunction.expected index cae0adc9306..a8627a56594 100644 --- a/idea/testData/stubs/ManyAnnotationsOnFunction.expected +++ b/idea/testData/stubs/ManyAnnotationsOnFunction.expected @@ -1,5 +1,16 @@ PsiJetFileStubImpl[package=] - FUN:PsiJetFunctionStubImpl[top fqName=foo name=foo] - ANNOTATION_ENTRY:PsiJetAnnotationStubImpl[shortName=Deprecated] - ANNOTATION_ENTRY:PsiJetAnnotationStubImpl[shortName=Override] - VALUE_PARAMETER_LIST:PsiJetParameterListStubImpl + PACKAGE_DIRECTIVE: + FUN:[fqName=foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, name=foo] + MODIFIER_LIST:[] + ANNOTATION: + ANNOTATION_ENTRY:[hasValueArguments=false, shortName=Deprecated] + CONSTRUCTOR_CALLEE: + TYPE_REFERENCE: + USER_TYPE:[isAbsoluteInRootPackage=false] + REFERENCE_EXPRESSION:[referencedName=Deprecated] + ANNOTATION_ENTRY:[hasValueArguments=false, shortName=Override] + CONSTRUCTOR_CALLEE: + TYPE_REFERENCE: + USER_TYPE:[isAbsoluteInRootPackage=false] + REFERENCE_EXPRESSION:[referencedName=Override] + VALUE_PARAMETER_LIST: diff --git a/idea/testData/stubs/NamedObject.expected b/idea/testData/stubs/NamedObject.expected index 6a1c3dd3de6..0fdb4d4b00d 100644 --- a/idea/testData/stubs/NamedObject.expected +++ b/idea/testData/stubs/NamedObject.expected @@ -1,5 +1,16 @@ PsiJetFileStubImpl[package=] - CLASS:PsiJetClassStubImpl[name=A fqn=A superNames=[]] - CLASS:PsiJetClassStubImpl[trait name=T fqn=T superNames=[]] - OBJECT_DECLARATION:PsiJetObjectStubImpl[top name=Test fqName=Test superNames=[AT]] - CLASS_BODY + PACKAGE_DIRECTIVE: + CLASS:[fqName=A, isEnumEntry=false, isLocal=false, isTopLevel=true, isTrait=false, name=A, superNames=[]] + CLASS:[fqName=T, isEnumEntry=false, isLocal=false, isTopLevel=true, isTrait=true, name=T, superNames=[]] + OBJECT_DECLARATION:[fqName=Test, isClassObject=false, isLocal=false, isObjectLiteral=false, isTopLevel=true, name=Test, superNames=[A, T]] + DELEGATION_SPECIFIER_LIST: + DELEGATOR_SUPER_CALL: + CONSTRUCTOR_CALLEE: + TYPE_REFERENCE: + USER_TYPE:[isAbsoluteInRootPackage=false] + REFERENCE_EXPRESSION:[referencedName=A] + DELEGATOR_SUPER_CLASS: + TYPE_REFERENCE: + USER_TYPE:[isAbsoluteInRootPackage=false] + REFERENCE_EXPRESSION:[referencedName=T] + CLASS_BODY: diff --git a/idea/testData/stubs/NotStorePropertiesFrom.expected b/idea/testData/stubs/NotStorePropertiesFrom.expected index d2c3af2032a..d1bcacba809 100644 --- a/idea/testData/stubs/NotStorePropertiesFrom.expected +++ b/idea/testData/stubs/NotStorePropertiesFrom.expected @@ -1,7 +1,9 @@ PsiJetFileStubImpl[package=] - CLASS:PsiJetClassStubImpl[name=Test fqn=Test superNames=[]] - VALUE_PARAMETER_LIST - CLASS_BODY - PROPERTY:PsiJetPropertyStubImpl[val name=test typeText=null bodyText=12] - FUN:PsiJetFunctionStubImpl[name=more] - VALUE_PARAMETER_LIST + PACKAGE_DIRECTIVE: + CLASS:[fqName=Test, isEnumEntry=false, isLocal=false, isTopLevel=true, isTrait=false, name=Test, superNames=[]] + VALUE_PARAMETER_LIST: + CLASS_BODY: + PROPERTY:[fqName=Test.test, hasDelegate=false, hasDelegateExpression=false, hasInitializer=true, hasReceiverTypeRef=false, hasReturnTypeRef=false, isTopLevel=false, isVar=false, name=test] + ANONYMOUS_INITIALIZER: + FUN:[fqName=Test.more, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=more] + VALUE_PARAMETER_LIST: diff --git a/idea/testData/stubs/NotStorePropertyFromDelegate.expected b/idea/testData/stubs/NotStorePropertyFromDelegate.expected index ccc75a5af15..e0f79a9d288 100644 --- a/idea/testData/stubs/NotStorePropertyFromDelegate.expected +++ b/idea/testData/stubs/NotStorePropertyFromDelegate.expected @@ -1,2 +1,3 @@ PsiJetFileStubImpl[package=] - PROPERTY:PsiJetPropertyStubImpl[val top fqName=a name=a typeText=null bodyText=null] + PACKAGE_DIRECTIVE: + PROPERTY:[fqName=a, hasDelegate=true, hasDelegateExpression=true, hasInitializer=false, hasReceiverTypeRef=false, hasReturnTypeRef=false, isTopLevel=true, isVar=false, name=a] diff --git a/idea/testData/stubs/NotStorePropertyFromInitializer.expected b/idea/testData/stubs/NotStorePropertyFromInitializer.expected index adf017b5d97..a079f2494f4 100644 --- a/idea/testData/stubs/NotStorePropertyFromInitializer.expected +++ b/idea/testData/stubs/NotStorePropertyFromInitializer.expected @@ -1,3 +1,7 @@ PsiJetFileStubImpl[package=] - FUN:PsiJetFunctionStubImpl[top fqName=some ext name=some] - VALUE_PARAMETER_LIST + PACKAGE_DIRECTIVE: + FUN:[fqName=some, hasBlockBody=false, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=true, isTopLevel=true, name=some] + TYPE_REFERENCE: + USER_TYPE:[isAbsoluteInRootPackage=false] + REFERENCE_EXPRESSION:[referencedName=DoubleArray] + VALUE_PARAMETER_LIST: diff --git a/idea/testData/stubs/PackageProperty.expected b/idea/testData/stubs/PackageProperty.expected index 941db7a6b0f..75032afc969 100644 --- a/idea/testData/stubs/PackageProperty.expected +++ b/idea/testData/stubs/PackageProperty.expected @@ -1,2 +1,6 @@ PsiJetFileStubImpl[package=test.testing] - PROPERTY:PsiJetPropertyStubImpl[val top fqName=test.testing.some name=some typeText=null bodyText=12] + PACKAGE_DIRECTIVE: + DOT_QUALIFIED_EXPRESSION: + REFERENCE_EXPRESSION:[referencedName=test] + REFERENCE_EXPRESSION:[referencedName=testing] + PROPERTY:[fqName=test.testing.some, hasDelegate=false, hasDelegateExpression=false, hasInitializer=true, hasReceiverTypeRef=false, hasReturnTypeRef=false, isTopLevel=true, isVar=false, name=some] diff --git a/idea/testData/stubs/ParametersWithFqName.expected b/idea/testData/stubs/ParametersWithFqName.expected index b251325a5bd..fb807833dc4 100644 --- a/idea/testData/stubs/ParametersWithFqName.expected +++ b/idea/testData/stubs/ParametersWithFqName.expected @@ -1,7 +1,18 @@ PsiJetFileStubImpl[package=test] - CLASS:PsiJetClassStubImpl[name=A fqn=test.A superNames=[]] - VALUE_PARAMETER_LIST - VALUE_PARAMETER:PsiJetParameterStubImpl[val name=b fqName=test.A.b typeText=Int defaultValue=null] - VALUE_PARAMETER:PsiJetParameterStubImpl[var name=c fqName=test.A.c typeText=String defaultValue=null] - VALUE_PARAMETER:PsiJetParameterStubImpl[val name=justParam typeText=Int defaultValue=null] - CLASS_BODY + PACKAGE_DIRECTIVE: + REFERENCE_EXPRESSION:[referencedName=test] + CLASS:[fqName=test.A, isEnumEntry=false, isLocal=false, isTopLevel=true, isTrait=false, name=A, superNames=[]] + VALUE_PARAMETER_LIST: + VALUE_PARAMETER:[fqName=test.A.b, hasDefaultValue=false, hasValOrValNode=true, isMutable=false, name=b] + TYPE_REFERENCE: + USER_TYPE:[isAbsoluteInRootPackage=false] + REFERENCE_EXPRESSION:[referencedName=Int] + VALUE_PARAMETER:[fqName=test.A.c, hasDefaultValue=false, hasValOrValNode=true, isMutable=true, name=c] + TYPE_REFERENCE: + USER_TYPE:[isAbsoluteInRootPackage=false] + REFERENCE_EXPRESSION:[referencedName=String] + VALUE_PARAMETER:[fqName=null, hasDefaultValue=false, hasValOrValNode=false, isMutable=false, name=justParam] + TYPE_REFERENCE: + USER_TYPE:[isAbsoluteInRootPackage=false] + REFERENCE_EXPRESSION:[referencedName=Int] + CLASS_BODY: diff --git a/idea/testData/stubs/QualifiedAnnotationOnFunction.expected b/idea/testData/stubs/QualifiedAnnotationOnFunction.expected index e40f432ab71..d5f84bafa24 100644 --- a/idea/testData/stubs/QualifiedAnnotationOnFunction.expected +++ b/idea/testData/stubs/QualifiedAnnotationOnFunction.expected @@ -1,4 +1,14 @@ PsiJetFileStubImpl[package=] - FUN:PsiJetFunctionStubImpl[top fqName=foo name=foo] - ANNOTATION_ENTRY:PsiJetAnnotationStubImpl[shortName=Deprecated] - VALUE_PARAMETER_LIST + PACKAGE_DIRECTIVE: + FUN:[fqName=foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, name=foo] + MODIFIER_LIST:[] + ANNOTATION_ENTRY:[hasValueArguments=false, shortName=Deprecated] + CONSTRUCTOR_CALLEE: + TYPE_REFERENCE: + USER_TYPE:[isAbsoluteInRootPackage=false] + USER_TYPE:[isAbsoluteInRootPackage=false] + USER_TYPE:[isAbsoluteInRootPackage=false] + REFERENCE_EXPRESSION:[referencedName=java] + REFERENCE_EXPRESSION:[referencedName=lang] + REFERENCE_EXPRESSION:[referencedName=Deprecated] + VALUE_PARAMETER_LIST: diff --git a/idea/testData/stubs/SimpleEnumBuild.expected b/idea/testData/stubs/SimpleEnumBuild.expected index 8429a1a3d66..93a70e8bcb2 100644 --- a/idea/testData/stubs/SimpleEnumBuild.expected +++ b/idea/testData/stubs/SimpleEnumBuild.expected @@ -1,5 +1,7 @@ PsiJetFileStubImpl[package=] - CLASS:PsiJetClassStubImpl[enumClass name=Test fqn=Test superNames=[]] - CLASS_BODY - ENUM_ENTRY:PsiJetClassStubImpl[enumEntry name=First fqn=Test.First superNames=[]] - ENUM_ENTRY:PsiJetClassStubImpl[enumEntry name=Second fqn=Test.Second superNames=[]] + PACKAGE_DIRECTIVE: + CLASS:[fqName=Test, isEnumEntry=false, isLocal=false, isTopLevel=true, isTrait=false, name=Test, superNames=[]] + MODIFIER_LIST:[enum] + CLASS_BODY: + ENUM_ENTRY:[fqName=Test.First, isEnumEntry=true, isLocal=false, isTopLevel=false, isTrait=false, name=First, superNames=[]] + ENUM_ENTRY:[fqName=Test.Second, isEnumEntry=true, isLocal=false, isTopLevel=false, isTrait=false, name=Second, superNames=[]]