Rename stub classes: PsiJet*Stub(Impl) -> Kotlin*Stub(Impl)

This commit is contained in:
Pavel V. Talanov
2014-10-31 18:26:07 +03:00
parent 5fb4f41030
commit c617b73424
101 changed files with 440 additions and 449 deletions
@@ -18,18 +18,18 @@ package org.jetbrains.jet.lang.psi;
import com.intellij.lang.ASTNode;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.stubs.PsiJetPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import java.util.List;
public class JetAnnotation extends JetElementImplStub<PsiJetPlaceHolderStub<JetAnnotation>> {
public class JetAnnotation extends JetElementImplStub<KotlinPlaceHolderStub<JetAnnotation>> {
public JetAnnotation(@NotNull ASTNode node) {
super(node);
}
public JetAnnotation(PsiJetPlaceHolderStub<JetAnnotation> stub) {
public JetAnnotation(KotlinPlaceHolderStub<JetAnnotation> stub) {
super(stub, JetStubElementTypes.ANNOTATION);
}
@@ -20,18 +20,18 @@ import com.intellij.lang.ASTNode;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.JetNodeTypes;
import org.jetbrains.jet.lang.psi.stubs.PsiJetAnnotationEntryStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinAnnotationEntryStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import java.util.Collections;
import java.util.List;
public class JetAnnotationEntry extends JetElementImplStub<PsiJetAnnotationEntryStub> implements JetCallElement {
public class JetAnnotationEntry extends JetElementImplStub<KotlinAnnotationEntryStub> implements JetCallElement {
public JetAnnotationEntry(@NotNull ASTNode node) {
super(node);
}
public JetAnnotationEntry(@NotNull PsiJetAnnotationEntryStub stub) {
public JetAnnotationEntry(@NotNull KotlinAnnotationEntryStub stub) {
super(stub, JetStubElementTypes.ANNOTATION_ENTRY);
}
@@ -57,7 +57,7 @@ public class JetAnnotationEntry extends JetElementImplStub<PsiJetAnnotationEntry
@Override
public JetValueArgumentList getValueArgumentList() {
PsiJetAnnotationEntryStub stub = getStub();
KotlinAnnotationEntryStub stub = getStub();
if (stub != null && !stub.hasValueArguments()) {
return null;
}
@@ -28,7 +28,7 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.JetNodeTypes;
import org.jetbrains.jet.lang.psi.addRemoveModifier.AddRemoveModifierPackage;
import org.jetbrains.jet.lang.psi.stubs.PsiJetClassStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinClassStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import org.jetbrains.jet.lang.resolve.name.FqName;
import org.jetbrains.jet.lexer.JetModifierKeywordToken;
@@ -38,13 +38,13 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class JetClass extends JetTypeParameterListOwnerStub<PsiJetClassStub> implements JetClassOrObject {
public class JetClass extends JetTypeParameterListOwnerStub<KotlinClassStub> implements JetClassOrObject {
public JetClass(@NotNull ASTNode node) {
super(node);
}
public JetClass(@NotNull PsiJetClassStub stub) {
public JetClass(@NotNull KotlinClassStub stub) {
super(stub, JetStubElementTypes.CLASS);
}
@@ -156,7 +156,7 @@ public class JetClass extends JetTypeParameterListOwnerStub<PsiJetClassStub> imp
}
public boolean isTrait() {
PsiJetClassStub stub = getStub();
KotlinClassStub stub = getStub();
if (stub != null) {
return stub.isTrait();
}
@@ -196,7 +196,7 @@ public class JetClass extends JetTypeParameterListOwnerStub<PsiJetClassStub> imp
@Nullable
private String getQualifiedName() {
PsiJetClassStub stub = getStub();
KotlinClassStub stub = getStub();
if (stub != null) {
FqName fqName = stub.getFqName();
return fqName == null ? null : fqName.asString();
@@ -230,7 +230,7 @@ public class JetClass extends JetTypeParameterListOwnerStub<PsiJetClassStub> imp
@Override
public boolean isLocal() {
PsiJetClassStub stub = getStub();
KotlinClassStub stub = getStub();
if (stub != null) {
return stub.isLocal();
}
@@ -22,7 +22,7 @@ import com.intellij.psi.tree.TokenSet;
import org.jetbrains.annotations.NotNull;
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.KotlinPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import org.jetbrains.jet.lexer.JetTokens;
@@ -31,13 +31,13 @@ import java.util.List;
import static org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes.*;
public class JetClassBody extends JetElementImplStub<PsiJetPlaceHolderStub<JetClassBody>> implements JetDeclarationContainer {
public class JetClassBody extends JetElementImplStub<KotlinPlaceHolderStub<JetClassBody>> implements JetDeclarationContainer {
public JetClassBody(@NotNull ASTNode node) {
super(node);
}
public JetClassBody(@NotNull PsiJetPlaceHolderStub<JetClassBody> stub) {
public JetClassBody(@NotNull KotlinPlaceHolderStub<JetClassBody> stub) {
super(stub, CLASS_BODY);
}
@@ -20,15 +20,15 @@ import com.intellij.lang.ASTNode;
import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.psi.stubs.PsiJetPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
public class JetClassInitializer extends JetDeclarationStub<PsiJetPlaceHolderStub<JetClassInitializer>> implements JetStatementExpression {
public class JetClassInitializer extends JetDeclarationStub<KotlinPlaceHolderStub<JetClassInitializer>> implements JetStatementExpression {
public JetClassInitializer(@NotNull ASTNode node) {
super(node);
}
public JetClassInitializer(@NotNull PsiJetPlaceHolderStub<JetClassInitializer> stub) {
public JetClassInitializer(@NotNull KotlinPlaceHolderStub<JetClassInitializer> stub) {
super(stub, JetStubElementTypes.ANONYMOUS_INITIALIZER);
}
@@ -20,16 +20,16 @@ import com.intellij.lang.ASTNode;
import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.psi.stubs.PsiJetPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import org.jetbrains.jet.lexer.JetTokens;
public class JetClassObject extends JetDeclarationStub<PsiJetPlaceHolderStub<JetClassObject>> implements JetStatementExpression {
public class JetClassObject extends JetDeclarationStub<KotlinPlaceHolderStub<JetClassObject>> implements JetStatementExpression {
public JetClassObject(@NotNull ASTNode node) {
super(node);
}
public JetClassObject(@NotNull PsiJetPlaceHolderStub<JetClassObject> stub) {
public JetClassObject(@NotNull KotlinPlaceHolderStub<JetClassObject> stub) {
super(stub, JetStubElementTypes.CLASS_OBJECT);
}
@@ -19,15 +19,15 @@ 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.lang.psi.stubs.PsiJetPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
public class JetConstructorCalleeExpression extends JetExpressionImplStub<PsiJetPlaceHolderStub<JetConstructorCalleeExpression>> {
public class JetConstructorCalleeExpression extends JetExpressionImplStub<KotlinPlaceHolderStub<JetConstructorCalleeExpression>> {
public JetConstructorCalleeExpression(@NotNull ASTNode node) {
super(node);
}
public JetConstructorCalleeExpression(@NotNull PsiJetPlaceHolderStub<JetConstructorCalleeExpression> stub) {
public JetConstructorCalleeExpression(@NotNull KotlinPlaceHolderStub<JetConstructorCalleeExpression> stub) {
super(stub, JetStubElementTypes.CONSTRUCTOR_CALLEE);
}
@@ -18,7 +18,7 @@ package org.jetbrains.jet.lang.psi;
import com.intellij.lang.ASTNode;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.stubs.PsiJetModifierListStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinModifierListStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
public class JetDeclarationModifierList extends JetModifierList {
@@ -26,7 +26,7 @@ public class JetDeclarationModifierList extends JetModifierList {
super(node);
}
public JetDeclarationModifierList(@NotNull PsiJetModifierListStub stub) {
public JetDeclarationModifierList(@NotNull KotlinModifierListStub stub) {
super(stub, JetStubElementTypes.MODIFIER_LIST);
}
}
@@ -21,10 +21,10 @@ import com.intellij.psi.stubs.IStubElementType;
import com.intellij.util.ArrayFactory;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.psi.stubs.PsiJetPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
public class JetDelegationSpecifier extends JetElementImplStub<PsiJetPlaceHolderStub<? extends JetDelegationSpecifier>> {
public class JetDelegationSpecifier extends JetElementImplStub<KotlinPlaceHolderStub<? extends JetDelegationSpecifier>> {
private static final JetDelegationSpecifier[] EMPTY_ARRAY = new JetDelegationSpecifier[0];
@@ -41,7 +41,7 @@ public class JetDelegationSpecifier extends JetElementImplStub<PsiJetPlaceHolder
}
public JetDelegationSpecifier(
@NotNull PsiJetPlaceHolderStub<? extends JetDelegationSpecifier> stub,
@NotNull KotlinPlaceHolderStub<? extends JetDelegationSpecifier> stub,
@NotNull IStubElementType nodeType) {
super(stub, nodeType);
}
@@ -18,18 +18,18 @@ package org.jetbrains.jet.lang.psi;
import com.intellij.lang.ASTNode;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.stubs.PsiJetPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import java.util.Arrays;
import java.util.List;
public class JetDelegationSpecifierList extends JetElementImplStub<PsiJetPlaceHolderStub<JetDelegationSpecifierList>> {
public class JetDelegationSpecifierList extends JetElementImplStub<KotlinPlaceHolderStub<JetDelegationSpecifierList>> {
public JetDelegationSpecifierList(@NotNull ASTNode node) {
super(node);
}
public JetDelegationSpecifierList(@NotNull PsiJetPlaceHolderStub<JetDelegationSpecifierList> stub) {
public JetDelegationSpecifierList(@NotNull KotlinPlaceHolderStub<JetDelegationSpecifierList> stub) {
super(stub, JetStubElementTypes.DELEGATION_SPECIFIER_LIST);
}
@@ -19,7 +19,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.lang.psi.stubs.PsiJetPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
public class JetDelegatorByExpressionSpecifier extends JetDelegationSpecifier {
@@ -27,7 +27,7 @@ public class JetDelegatorByExpressionSpecifier extends JetDelegationSpecifier {
super(node);
}
public JetDelegatorByExpressionSpecifier(@NotNull PsiJetPlaceHolderStub<? extends JetDelegationSpecifier> stub) {
public JetDelegatorByExpressionSpecifier(@NotNull KotlinPlaceHolderStub<? extends JetDelegationSpecifier> stub) {
super(stub, JetStubElementTypes.DELEGATOR_BY);
}
@@ -20,7 +20,7 @@ import com.intellij.lang.ASTNode;
import org.jetbrains.annotations.NotNull;
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.KotlinPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import java.util.Collections;
@@ -31,7 +31,7 @@ public class JetDelegatorToSuperCall extends JetDelegationSpecifier implements J
super(node);
}
public JetDelegatorToSuperCall(@NotNull PsiJetPlaceHolderStub<? extends JetDelegationSpecifier> stub) {
public JetDelegatorToSuperCall(@NotNull KotlinPlaceHolderStub<? extends JetDelegationSpecifier> stub) {
super(stub, JetStubElementTypes.DELEGATOR_SUPER_CALL);
}
@@ -18,7 +18,7 @@ package org.jetbrains.jet.lang.psi;
import com.intellij.lang.ASTNode;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.stubs.PsiJetPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
public class JetDelegatorToSuperClass extends JetDelegationSpecifier {
@@ -26,7 +26,7 @@ public class JetDelegatorToSuperClass extends JetDelegationSpecifier {
super(node);
}
public JetDelegatorToSuperClass(@NotNull PsiJetPlaceHolderStub<? extends JetDelegationSpecifier> stub) {
public JetDelegatorToSuperClass(@NotNull KotlinPlaceHolderStub<? extends JetDelegationSpecifier> stub) {
super(stub, JetStubElementTypes.DELEGATOR_SUPER_CLASS);
}
@@ -20,7 +20,7 @@ import com.intellij.lang.ASTNode;
import org.jetbrains.annotations.NotNull;
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.KotlinPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import java.util.Collections;
@@ -32,7 +32,7 @@ public class JetDelegatorToThisCall extends JetDelegationSpecifier implements Je
super(node);
}
public JetDelegatorToThisCall(@NotNull PsiJetPlaceHolderStub<? extends JetDelegationSpecifier> stub) {
public JetDelegatorToThisCall(@NotNull KotlinPlaceHolderStub<? extends JetDelegationSpecifier> stub) {
super(stub, JetStubElementTypes.THIS_CALL);
}
@@ -20,13 +20,13 @@ import com.intellij.lang.ASTNode;
import com.intellij.openapi.diagnostic.Logger;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.psi.stubs.PsiJetPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import org.jetbrains.jet.lexer.JetToken;
import static org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes.INSIDE_DIRECTIVE_EXPRESSIONS;
public class JetDotQualifiedExpression extends JetExpressionImplStub<PsiJetPlaceHolderStub<JetDotQualifiedExpression>>
public class JetDotQualifiedExpression extends JetExpressionImplStub<KotlinPlaceHolderStub<JetDotQualifiedExpression>>
implements JetQualifiedExpression {
private static final Logger LOG = Logger.getInstance(JetDotQualifiedExpression.class);
@@ -35,7 +35,7 @@ public class JetDotQualifiedExpression extends JetExpressionImplStub<PsiJetPlace
super(node);
}
public JetDotQualifiedExpression(@NotNull PsiJetPlaceHolderStub<JetDotQualifiedExpression> stub) {
public JetDotQualifiedExpression(@NotNull KotlinPlaceHolderStub<JetDotQualifiedExpression> stub) {
super(stub, JetStubElementTypes.DOT_QUALIFIED_EXPRESSION);
}
@@ -47,7 +47,7 @@ public class JetDotQualifiedExpression extends JetExpressionImplStub<PsiJetPlace
@NotNull
@Override
public JetExpression getReceiverExpression() {
PsiJetPlaceHolderStub<JetDotQualifiedExpression> stub = getStub();
KotlinPlaceHolderStub<JetDotQualifiedExpression> stub = getStub();
if (stub != null) {
JetExpression[] childExpressionsByStub = getChildExpressionsByStub(stub);
if (childExpressionsByStub != null) {
@@ -60,7 +60,7 @@ public class JetDotQualifiedExpression extends JetExpressionImplStub<PsiJetPlace
@Nullable
@Override
public JetExpression getSelectorExpression() {
PsiJetPlaceHolderStub<JetDotQualifiedExpression> stub = getStub();
KotlinPlaceHolderStub<JetDotQualifiedExpression> stub = getStub();
if (stub != null) {
JetExpression[] childExpressionsByStub = getChildExpressionsByStub(stub);
if (childExpressionsByStub != null && childExpressionsByStub.length == 2) {
@@ -72,7 +72,7 @@ public class JetDotQualifiedExpression extends JetExpressionImplStub<PsiJetPlace
@Nullable
private JetExpression[] getChildExpressionsByStub(@NotNull PsiJetPlaceHolderStub<JetDotQualifiedExpression> stub) {
private JetExpression[] getChildExpressionsByStub(@NotNull KotlinPlaceHolderStub<JetDotQualifiedExpression> stub) {
if (stub.getParentStubOfType(JetImportDirective.class) == null && stub.getParentStubOfType(JetPackageDirective.class) == null) {
LOG.error("JetDotQualifiedExpression should only have stubs inside import or package directives.\n " +
"Stubs were created for:\n " + getText() +
@@ -22,7 +22,7 @@ import com.intellij.util.IncorrectOperationException;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.psi.stubs.PsiJetClassStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinClassStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import java.util.Collections;
@@ -33,13 +33,13 @@ public class JetEnumEntry extends JetClass {
super(node);
}
public JetEnumEntry(@NotNull PsiJetClassStub stub) {
public JetEnumEntry(@NotNull KotlinClassStub stub) {
super(stub);
}
@Override
public String getName() {
PsiJetClassStub classStub = getStub();
KotlinClassStub classStub = getStub();
if (classStub != null) {
return classStub.getName();
}
@@ -29,7 +29,7 @@ import com.intellij.psi.util.PsiTreeUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.JetNodeTypes;
import org.jetbrains.jet.lang.psi.stubs.PsiJetFileStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinFileStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetPlaceHolderStubElementType;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import org.jetbrains.jet.lang.resolve.name.FqName;
@@ -72,7 +72,7 @@ public class JetFile extends PsiFileBase implements JetDeclarationContainer, Jet
@NotNull
@Override
public List<JetDeclaration> getDeclarations() {
PsiJetFileStub stub = getStub();
KotlinFileStub stub = getStub();
if (stub != null) {
return Arrays.asList(stub.getChildrenByType(JetStubElementTypes.DECLARATION_TYPES, JetDeclaration.ARRAY_FACTORY));
}
@@ -94,7 +94,7 @@ public class JetFile extends PsiFileBase implements JetDeclarationContainer, Jet
@NotNull JetPlaceHolderStubElementType<T> elementType,
@NotNull Class<T> elementClass
) {
PsiJetFileStub stub = getStub();
KotlinFileStub stub = getStub();
if (stub != null) {
StubElement<T> importListStub = stub.findChildStubByType(elementType);
return importListStub != null ? importListStub.getPsi() : null;
@@ -121,7 +121,7 @@ public class JetFile extends PsiFileBase implements JetDeclarationContainer, Jet
// scripts have no package directive, all other files must have package directives
@Nullable
public JetPackageDirective getPackageDirective() {
PsiJetFileStub stub = getStub();
KotlinFileStub stub = getStub();
if (stub != null) {
StubElement<JetPackageDirective> packageDirectiveStub = stub.findChildStubByType(JetStubElementTypes.PACKAGE_DIRECTIVE);
return packageDirectiveStub != null ? packageDirectiveStub.getPsi() : null;
@@ -139,7 +139,7 @@ public class JetFile extends PsiFileBase implements JetDeclarationContainer, Jet
@NotNull
public FqName getPackageFqName() {
PsiJetFileStub stub = getStub();
KotlinFileStub stub = getStub();
if (stub != null) {
return stub.getPackageFqName();
}
@@ -157,8 +157,8 @@ public class JetFile extends PsiFileBase implements JetDeclarationContainer, Jet
@Override
@Nullable
public PsiJetFileStub getStub() {
return (PsiJetFileStub) super.getStub();
public KotlinFileStub getStub() {
return (KotlinFileStub) super.getStub();
}
@NotNull
@@ -177,7 +177,7 @@ public class JetFile extends PsiFileBase implements JetDeclarationContainer, Jet
}
public boolean isScript() {
PsiJetFileStub stub = getStub();
KotlinFileStub stub = getStub();
if (stub != null) {
return stub.isScript();
}
@@ -20,18 +20,18 @@ import com.intellij.lang.ASTNode;
import kotlin.Function1;
import kotlin.KotlinPackage;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.stubs.PsiJetPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import java.util.List;
public class JetFileAnnotationList extends JetElementImplStub<PsiJetPlaceHolderStub<JetFileAnnotationList>> {
public class JetFileAnnotationList extends JetElementImplStub<KotlinPlaceHolderStub<JetFileAnnotationList>> {
public JetFileAnnotationList(@NotNull ASTNode node) {
super(node);
}
public JetFileAnnotationList(@NotNull PsiJetPlaceHolderStub<JetFileAnnotationList> stub) {
public JetFileAnnotationList(@NotNull KotlinPlaceHolderStub<JetFileAnnotationList> stub) {
super(stub, JetStubElementTypes.FILE_ANNOTATION_LIST);
}
@@ -20,7 +20,7 @@ import com.google.common.collect.Lists;
import com.intellij.lang.ASTNode;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.psi.stubs.PsiJetPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import org.jetbrains.jet.lexer.JetToken;
import org.jetbrains.jet.lexer.JetTokens;
@@ -29,7 +29,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class JetFunctionType extends JetElementImplStub<PsiJetPlaceHolderStub<JetFunctionType>> implements JetTypeElement {
public class JetFunctionType extends JetElementImplStub<KotlinPlaceHolderStub<JetFunctionType>> implements JetTypeElement {
public static final JetToken RETURN_TYPE_SEPARATOR = JetTokens.ARROW;
@@ -37,7 +37,7 @@ public class JetFunctionType extends JetElementImplStub<PsiJetPlaceHolderStub<Je
super(node);
}
public JetFunctionType(@NotNull PsiJetPlaceHolderStub<JetFunctionType> stub) {
public JetFunctionType(@NotNull KotlinPlaceHolderStub<JetFunctionType> stub) {
super(stub, JetStubElementTypes.FUNCTION_TYPE);
}
@@ -18,15 +18,15 @@ package org.jetbrains.jet.lang.psi;
import com.intellij.lang.ASTNode;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.stubs.PsiJetPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
public class JetFunctionTypeReceiver extends JetElementImplStub<PsiJetPlaceHolderStub<JetFunctionTypeReceiver>> {
public class JetFunctionTypeReceiver extends JetElementImplStub<KotlinPlaceHolderStub<JetFunctionTypeReceiver>> {
public JetFunctionTypeReceiver(@NotNull ASTNode node) {
super(node);
}
public JetFunctionTypeReceiver(@NotNull PsiJetPlaceHolderStub<JetFunctionTypeReceiver> stub) {
public JetFunctionTypeReceiver(@NotNull KotlinPlaceHolderStub<JetFunctionTypeReceiver> stub) {
super(stub, JetStubElementTypes.FUNCTION_TYPE_RECEIVER);
}
@@ -21,20 +21,20 @@ import com.intellij.psi.tree.IElementType;
import com.intellij.psi.util.PsiTreeUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.psi.stubs.PsiJetImportDirectiveStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinImportDirectiveStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import org.jetbrains.jet.lang.resolve.ImportPath;
import org.jetbrains.jet.lang.resolve.name.FqName;
import org.jetbrains.jet.lang.resolve.name.Name;
import org.jetbrains.jet.lexer.JetTokens;
public class JetImportDirective extends JetElementImplStub<PsiJetImportDirectiveStub> {
public class JetImportDirective extends JetElementImplStub<KotlinImportDirectiveStub> {
public JetImportDirective(@NotNull ASTNode node) {
super(node);
}
public JetImportDirective(@NotNull PsiJetImportDirectiveStub stub) {
public JetImportDirective(@NotNull KotlinImportDirectiveStub stub) {
super(stub, JetStubElementTypes.IMPORT_DIRECTIVE);
}
@@ -44,7 +44,7 @@ public class JetImportDirective extends JetElementImplStub<PsiJetImportDirective
}
public boolean isAbsoluteInRootPackage() {
PsiJetImportDirectiveStub stub = getStub();
KotlinImportDirectiveStub stub = getStub();
if (stub != null) {
return stub.isAbsoluteInRootPackage();
}
@@ -78,7 +78,7 @@ public class JetImportDirective extends JetElementImplStub<PsiJetImportDirective
@Nullable
public String getAliasName() {
PsiJetImportDirectiveStub stub = getStub();
KotlinImportDirectiveStub stub = getStub();
if (stub != null) {
return stub.getAliasName();
}
@@ -90,7 +90,7 @@ public class JetImportDirective extends JetElementImplStub<PsiJetImportDirective
}
public boolean isAllUnder() {
PsiJetImportDirectiveStub stub = getStub();
KotlinImportDirectiveStub stub = getStub();
if (stub != null) {
return stub.isAllUnder();
}
@@ -117,7 +117,7 @@ public class JetImportDirective extends JetElementImplStub<PsiJetImportDirective
}
public boolean isValidImport() {
PsiJetImportDirectiveStub stub = getStub();
KotlinImportDirectiveStub stub = getStub();
if (stub != null) {
return stub.isValid();
}
@@ -18,18 +18,18 @@ package org.jetbrains.jet.lang.psi;
import com.intellij.lang.ASTNode;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.stubs.PsiJetPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import java.util.List;
public class JetImportList extends JetElementImplStub<PsiJetPlaceHolderStub<JetImportList>> {
public class JetImportList extends JetElementImplStub<KotlinPlaceHolderStub<JetImportList>> {
public JetImportList(@NotNull ASTNode node) {
super(node);
}
public JetImportList(@NotNull PsiJetPlaceHolderStub<JetImportList> stub) {
public JetImportList(@NotNull KotlinPlaceHolderStub<JetImportList> stub) {
super(stub, JetStubElementTypes.IMPORT_LIST);
}
@@ -17,21 +17,19 @@
package org.jetbrains.jet.lang.psi;
import com.intellij.lang.ASTNode;
import com.intellij.psi.stubs.IStubElementType;
import com.intellij.psi.util.PsiTreeUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.stubs.PsiJetPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import java.util.Arrays;
import java.util.List;
public class JetInitializerList extends JetElementImplStub<PsiJetPlaceHolderStub<JetInitializerList>> {
public class JetInitializerList extends JetElementImplStub<KotlinPlaceHolderStub<JetInitializerList>> {
public JetInitializerList(@NotNull ASTNode node) {
super(node);
}
public JetInitializerList(@NotNull PsiJetPlaceHolderStub<JetInitializerList> stub) {
public JetInitializerList(@NotNull KotlinPlaceHolderStub<JetInitializerList> stub) {
super(stub, JetStubElementTypes.INITIALIZER_LIST);
}
@@ -22,7 +22,7 @@ import com.intellij.psi.PsiElement;
import com.intellij.psi.stubs.IStubElementType;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.psi.stubs.PsiJetModifierListStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinModifierListStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import org.jetbrains.jet.lexer.JetModifierKeywordToken;
import org.jetbrains.jet.lexer.JetToken;
@@ -31,9 +31,9 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public abstract class JetModifierList extends JetElementImplStub<PsiJetModifierListStub> {
public abstract class JetModifierList extends JetElementImplStub<KotlinModifierListStub> {
public JetModifierList(@NotNull PsiJetModifierListStub stub, @NotNull IStubElementType nodeType) {
public JetModifierList(@NotNull KotlinModifierListStub stub, @NotNull IStubElementType nodeType) {
super(stub, nodeType);
}
@@ -63,7 +63,7 @@ public abstract class JetModifierList extends JetElementImplStub<PsiJetModifierL
}
public boolean hasModifier(@NotNull JetModifierKeywordToken token) {
PsiJetModifierListStub stub = getStub();
KotlinModifierListStub stub = getStub();
if (stub != null) {
return stub.hasModifier(token);
}
@@ -22,14 +22,14 @@ import com.intellij.psi.tree.IElementType;
import com.intellij.psi.tree.TokenSet;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.psi.stubs.PsiJetNameReferenceExpressionStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinNameReferenceExpressionStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import org.jetbrains.jet.lang.resolve.name.Name;
import org.jetbrains.jet.lexer.JetTokens;
import static org.jetbrains.jet.lexer.JetTokens.*;
public class JetNameReferenceExpression extends JetExpressionImplStub<PsiJetNameReferenceExpressionStub> implements JetSimpleNameExpression {
public class JetNameReferenceExpression extends JetExpressionImplStub<KotlinNameReferenceExpressionStub> implements JetSimpleNameExpression {
private static final TokenSet NAME_REFERENCE_EXPRESSIONS = TokenSet.create(IDENTIFIER, FIELD_IDENTIFIER, THIS_KEYWORD, SUPER_KEYWORD);
@@ -37,14 +37,14 @@ public class JetNameReferenceExpression extends JetExpressionImplStub<PsiJetName
super(node);
}
public JetNameReferenceExpression(@NotNull PsiJetNameReferenceExpressionStub stub) {
public JetNameReferenceExpression(@NotNull KotlinNameReferenceExpressionStub stub) {
super(stub, JetStubElementTypes.REFERENCE_EXPRESSION);
}
@Override
@NotNull
public String getReferencedName() {
PsiJetNameReferenceExpressionStub stub = getStub();
KotlinNameReferenceExpressionStub stub = getStub();
if (stub != null) {
return stub.getReferencedName();
}
@@ -26,14 +26,14 @@ import com.intellij.util.IncorrectOperationException;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.psi.stubs.PsiJetStubWithFqName;
import org.jetbrains.jet.lang.psi.stubs.KotlinStubWithFqName;
import org.jetbrains.jet.lang.resolve.name.FqName;
import org.jetbrains.jet.lang.resolve.name.Name;
import org.jetbrains.jet.lexer.JetTokens;
import static org.jetbrains.jet.lang.psi.PsiPackage.JetPsiFactory;
abstract class JetNamedDeclarationStub<T extends PsiJetStubWithFqName> extends JetDeclarationStub<T> implements JetNamedDeclaration {
abstract class JetNamedDeclarationStub<T extends KotlinStubWithFqName> extends JetDeclarationStub<T> implements JetNamedDeclaration {
public JetNamedDeclarationStub(@NotNull T stub, @NotNull IStubElementType nodeType) {
super(stub, nodeType);
}
@@ -25,7 +25,7 @@ import com.intellij.psi.tree.IElementType;
import com.intellij.psi.util.PsiTreeUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.psi.stubs.PsiJetFunctionStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinFunctionStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import org.jetbrains.jet.lang.psi.typeRefHelpers.TypeRefHelpersPackage;
import org.jetbrains.jet.lexer.JetTokens;
@@ -33,13 +33,13 @@ import org.jetbrains.jet.lexer.JetTokens;
import java.util.Collections;
import java.util.List;
public class JetNamedFunction extends JetTypeParameterListOwnerStub<PsiJetFunctionStub>
public class JetNamedFunction extends JetTypeParameterListOwnerStub<KotlinFunctionStub>
implements JetFunction, JetWithExpressionInitializer, PsiModifiableCodeBlock {
public JetNamedFunction(@NotNull ASTNode node) {
super(node);
}
public JetNamedFunction(@NotNull PsiJetFunctionStub stub) {
public JetNamedFunction(@NotNull KotlinFunctionStub stub) {
super(stub, JetStubElementTypes.FUNCTION);
}
@@ -49,7 +49,7 @@ public class JetNamedFunction extends JetTypeParameterListOwnerStub<PsiJetFuncti
}
public boolean hasTypeParameterListBeforeFunctionName() {
PsiJetFunctionStub stub = getStub();
KotlinFunctionStub stub = getStub();
if (stub != null) {
return stub.hasTypeParameterListBeforeFunctionName();
}
@@ -70,7 +70,7 @@ public class JetNamedFunction extends JetTypeParameterListOwnerStub<PsiJetFuncti
@Override
public boolean hasBlockBody() {
PsiJetFunctionStub stub = getStub();
KotlinFunctionStub stub = getStub();
if (stub != null) {
return stub.hasBlockBody();
}
@@ -119,7 +119,7 @@ public class JetNamedFunction extends JetTypeParameterListOwnerStub<PsiJetFuncti
@Override
public boolean hasBody() {
PsiJetFunctionStub stub = getStub();
KotlinFunctionStub stub = getStub();
if (stub != null) {
return stub.hasBody();
}
@@ -134,7 +134,7 @@ public class JetNamedFunction extends JetTypeParameterListOwnerStub<PsiJetFuncti
@Override
@Nullable
public JetTypeReference getReceiverTypeReference() {
PsiJetFunctionStub stub = getStub();
KotlinFunctionStub stub = getStub();
if (stub != null) {
if (!stub.isExtension()) {
return null;
@@ -168,7 +168,7 @@ public class JetNamedFunction extends JetTypeParameterListOwnerStub<PsiJetFuncti
@Override
@Nullable
public JetTypeReference getTypeReference() {
PsiJetFunctionStub stub = getStub();
KotlinFunctionStub stub = getStub();
if (stub != null) {
List<JetTypeReference> typeReferences = getStubOrPsiChildrenAsList(JetStubElementTypes.TYPE_REFERENCE);
int returnTypeIndex = stub.isExtension() ? 1 : 0;
@@ -19,19 +19,19 @@ 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.lang.psi.stubs.PsiJetPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import org.jetbrains.jet.lexer.JetTokens;
import java.util.Collections;
import java.util.List;
public class JetNullableType extends JetElementImplStub<PsiJetPlaceHolderStub<JetNullableType>> implements JetTypeElement {
public class JetNullableType extends JetElementImplStub<KotlinPlaceHolderStub<JetNullableType>> implements JetTypeElement {
public JetNullableType(@NotNull ASTNode node) {
super(node);
}
public JetNullableType(@NotNull PsiJetPlaceHolderStub<JetNullableType> stub) {
public JetNullableType(@NotNull KotlinPlaceHolderStub<JetNullableType> stub) {
super(stub, JetStubElementTypes.NULLABLE_TYPE);
}
@@ -25,7 +25,7 @@ import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.JetNodeTypes;
import org.jetbrains.jet.lang.psi.stubs.PsiJetObjectStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinObjectStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import org.jetbrains.jet.lexer.JetModifierKeywordToken;
import org.jetbrains.jet.lexer.JetTokens;
@@ -33,18 +33,18 @@ import org.jetbrains.jet.lexer.JetTokens;
import java.util.Collections;
import java.util.List;
public class JetObjectDeclaration extends JetNamedDeclarationStub<PsiJetObjectStub> implements JetClassOrObject {
public class JetObjectDeclaration extends JetNamedDeclarationStub<KotlinObjectStub> implements JetClassOrObject {
public JetObjectDeclaration(@NotNull ASTNode node) {
super(node);
}
public JetObjectDeclaration(@NotNull PsiJetObjectStub stub) {
public JetObjectDeclaration(@NotNull KotlinObjectStub stub) {
super(stub, JetStubElementTypes.OBJECT_DECLARATION);
}
@Override
public String getName() {
PsiJetObjectStub stub = getStub();
KotlinObjectStub stub = getStub();
if (stub != null) {
return stub.getName();
}
@@ -55,7 +55,7 @@ public class JetObjectDeclaration extends JetNamedDeclarationStub<PsiJetObjectSt
@Override
public boolean isTopLevel() {
PsiJetObjectStub stub = getStub();
KotlinObjectStub stub = getStub();
if (stub != null) {
return stub.isTopLevel();
}
@@ -93,7 +93,7 @@ public class JetObjectDeclaration extends JetNamedDeclarationStub<PsiJetObjectSt
}
public boolean isClassObject() {
PsiJetObjectStub stub = getStub();
KotlinObjectStub stub = getStub();
if (stub != null) {
return stub.isClassObject();
}
@@ -149,7 +149,7 @@ public class JetObjectDeclaration extends JetNamedDeclarationStub<PsiJetObjectSt
@Override
public boolean isLocal() {
PsiJetObjectStub stub = getStub();
KotlinObjectStub stub = getStub();
if (stub != null) {
return stub.isLocal();
}
@@ -171,7 +171,7 @@ public class JetObjectDeclaration extends JetNamedDeclarationStub<PsiJetObjectSt
}
public boolean isObjectLiteral() {
PsiJetObjectStub stub = getStub();
KotlinObjectStub stub = getStub();
if (stub != null) {
return stub.isObjectLiteral();
}
@@ -22,7 +22,7 @@ import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.psi.psiUtil.PsiUtilPackage;
import org.jetbrains.jet.lang.psi.stubs.PsiJetPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import org.jetbrains.jet.lang.resolve.name.FqName;
import org.jetbrains.jet.lang.resolve.name.Name;
@@ -31,14 +31,14 @@ import org.jetbrains.jet.lang.resolve.name.SpecialNames;
import java.util.Collections;
import java.util.List;
public class JetPackageDirective extends JetModifierListOwnerStub<PsiJetPlaceHolderStub<JetPackageDirective>> implements JetReferenceExpression {
public class JetPackageDirective extends JetModifierListOwnerStub<KotlinPlaceHolderStub<JetPackageDirective>> implements JetReferenceExpression {
private String qualifiedNameCache = null;
public JetPackageDirective(@NotNull ASTNode node) {
super(node);
}
public JetPackageDirective(@NotNull PsiJetPlaceHolderStub<JetPackageDirective> stub) {
public JetPackageDirective(@NotNull KotlinPlaceHolderStub<JetPackageDirective> stub) {
super(stub, JetStubElementTypes.PACKAGE_DIRECTIVE);
}
@@ -22,7 +22,7 @@ import com.intellij.navigation.ItemPresentationProviders;
import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.psi.stubs.PsiJetParameterStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinParameterStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import org.jetbrains.jet.lang.psi.typeRefHelpers.TypeRefHelpersPackage;
import org.jetbrains.jet.lexer.JetTokens;
@@ -30,13 +30,13 @@ import org.jetbrains.jet.lexer.JetTokens;
import java.util.Collections;
import java.util.List;
public class JetParameter extends JetNamedDeclarationStub<PsiJetParameterStub> implements JetCallableDeclaration {
public class JetParameter extends JetNamedDeclarationStub<KotlinParameterStub> implements JetCallableDeclaration {
public JetParameter(@NotNull ASTNode node) {
super(node);
}
public JetParameter(@NotNull PsiJetParameterStub stub) {
public JetParameter(@NotNull KotlinParameterStub stub) {
super(stub, JetStubElementTypes.VALUE_PARAMETER);
}
@@ -64,7 +64,7 @@ public class JetParameter extends JetNamedDeclarationStub<PsiJetParameterStub> i
}
public boolean hasDefaultValue() {
PsiJetParameterStub stub = getStub();
KotlinParameterStub stub = getStub();
if (stub != null) {
return stub.hasDefaultValue();
}
@@ -73,7 +73,7 @@ public class JetParameter extends JetNamedDeclarationStub<PsiJetParameterStub> i
@Nullable
public JetExpression getDefaultValue() {
PsiJetParameterStub stub = getStub();
KotlinParameterStub stub = getStub();
if (stub != null && !stub.hasDefaultValue()) {
return null;
}
@@ -91,7 +91,7 @@ public class JetParameter extends JetNamedDeclarationStub<PsiJetParameterStub> i
}
public boolean isMutable() {
PsiJetParameterStub stub = getStub();
KotlinParameterStub stub = getStub();
if (stub != null) {
return stub.isMutable();
}
@@ -105,7 +105,7 @@ public class JetParameter extends JetNamedDeclarationStub<PsiJetParameterStub> i
}
public boolean hasValOrVarNode() {
PsiJetParameterStub stub = getStub();
KotlinParameterStub stub = getStub();
if (stub != null) {
return stub.hasValOrValNode();
}
@@ -114,7 +114,7 @@ public class JetParameter extends JetNamedDeclarationStub<PsiJetParameterStub> i
@Nullable
public ASTNode getValOrVarNode() {
PsiJetParameterStub stub = getStub();
KotlinParameterStub stub = getStub();
if (stub != null && !stub.hasValOrValNode()) {
return null;
}
@@ -18,17 +18,17 @@ package org.jetbrains.jet.lang.psi;
import com.intellij.lang.ASTNode;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.stubs.PsiJetPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import java.util.List;
public class JetParameterList extends JetElementImplStub<PsiJetPlaceHolderStub<JetParameterList>> {
public class JetParameterList extends JetElementImplStub<KotlinPlaceHolderStub<JetParameterList>> {
public JetParameterList(@NotNull ASTNode node) {
super(node);
}
public JetParameterList(@NotNull PsiJetPlaceHolderStub<JetParameterList> stub) {
public JetParameterList(@NotNull KotlinPlaceHolderStub<JetParameterList> stub) {
super(stub, JetStubElementTypes.VALUE_PARAMETER_LIST);
}
@@ -18,7 +18,7 @@ package org.jetbrains.jet.lang.psi;
import com.intellij.lang.ASTNode;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.stubs.PsiJetModifierListStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinModifierListStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
public class JetPrimaryConstructorModifierList extends JetModifierList {
@@ -26,7 +26,7 @@ public class JetPrimaryConstructorModifierList extends JetModifierList {
super(node);
}
public JetPrimaryConstructorModifierList(@NotNull PsiJetModifierListStub stub) {
public JetPrimaryConstructorModifierList(@NotNull KotlinModifierListStub stub) {
super(stub, JetStubElementTypes.PRIMARY_CONSTRUCTOR_MODIFIER_LIST);
}
}
@@ -28,7 +28,7 @@ import com.intellij.psi.util.PsiTreeUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.JetNodeTypes;
import org.jetbrains.jet.lang.psi.stubs.PsiJetPropertyStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinPropertyStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import org.jetbrains.jet.lang.psi.typeRefHelpers.TypeRefHelpersPackage;
import org.jetbrains.jet.lexer.JetTokens;
@@ -38,7 +38,7 @@ import java.util.List;
import static org.jetbrains.jet.JetNodeTypes.PROPERTY_DELEGATE;
import static org.jetbrains.jet.lexer.JetTokens.*;
public class JetProperty extends JetTypeParameterListOwnerStub<PsiJetPropertyStub>
public class JetProperty extends JetTypeParameterListOwnerStub<KotlinPropertyStub>
implements JetVariableDeclaration, PsiModifiableCodeBlock {
private static final Logger LOG = Logger.getInstance(JetProperty.class);
@@ -47,7 +47,7 @@ public class JetProperty extends JetTypeParameterListOwnerStub<PsiJetPropertyStu
super(node);
}
public JetProperty(@NotNull PsiJetPropertyStub stub) {
public JetProperty(@NotNull KotlinPropertyStub stub) {
super(stub, JetStubElementTypes.PROPERTY);
}
@@ -58,7 +58,7 @@ public class JetProperty extends JetTypeParameterListOwnerStub<PsiJetPropertyStu
@Override
public boolean isVar() {
PsiJetPropertyStub stub = getStub();
KotlinPropertyStub stub = getStub();
if (stub != null) {
return stub.isVar();
}
@@ -72,7 +72,7 @@ public class JetProperty extends JetTypeParameterListOwnerStub<PsiJetPropertyStu
}
public boolean isTopLevel() {
PsiJetPropertyStub stub = getStub();
KotlinPropertyStub stub = getStub();
if (stub != null) {
return stub.isTopLevel();
}
@@ -89,7 +89,7 @@ public class JetProperty extends JetTypeParameterListOwnerStub<PsiJetPropertyStu
@Override
@Nullable
public JetTypeReference getReceiverTypeReference() {
PsiJetPropertyStub stub = getStub();
KotlinPropertyStub stub = getStub();
if (stub != null) {
if (!stub.hasReceiverTypeRef()) {
return null;
@@ -120,7 +120,7 @@ public class JetProperty extends JetTypeParameterListOwnerStub<PsiJetPropertyStu
@Override
@Nullable
public JetTypeReference getTypeReference() {
PsiJetPropertyStub stub = getStub();
KotlinPropertyStub stub = getStub();
if (stub != null) {
if (!stub.hasReturnTypeRef()) {
return null;
@@ -174,7 +174,7 @@ public class JetProperty extends JetTypeParameterListOwnerStub<PsiJetPropertyStu
}
public boolean hasDelegate() {
PsiJetPropertyStub stub = getStub();
KotlinPropertyStub stub = getStub();
if (stub != null) {
return stub.hasDelegate();
}
@@ -187,7 +187,7 @@ public class JetProperty extends JetTypeParameterListOwnerStub<PsiJetPropertyStu
}
public boolean hasDelegateExpression() {
PsiJetPropertyStub stub = getStub();
KotlinPropertyStub stub = getStub();
if (stub != null) {
return stub.hasDelegateExpression();
}
@@ -205,7 +205,7 @@ public class JetProperty extends JetTypeParameterListOwnerStub<PsiJetPropertyStu
@Override
public boolean hasInitializer() {
PsiJetPropertyStub stub = getStub();
KotlinPropertyStub stub = getStub();
if (stub != null) {
return stub.hasInitializer();
}
@@ -21,20 +21,20 @@ import com.intellij.psi.PsiElement;
import com.intellij.psi.util.PsiTreeUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.psi.stubs.PsiJetPropertyAccessorStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinPropertyAccessorStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import org.jetbrains.jet.lexer.JetTokens;
import java.util.Collections;
import java.util.List;
public class JetPropertyAccessor extends JetDeclarationStub<PsiJetPropertyAccessorStub>
public class JetPropertyAccessor extends JetDeclarationStub<KotlinPropertyAccessorStub>
implements JetDeclarationWithBody, JetModifierListOwner, JetWithExpressionInitializer {
public JetPropertyAccessor(@NotNull ASTNode node) {
super(node);
}
public JetPropertyAccessor(@NotNull PsiJetPropertyAccessorStub stub) {
public JetPropertyAccessor(@NotNull KotlinPropertyAccessorStub stub) {
super(stub, JetStubElementTypes.PROPERTY_ACCESSOR);
}
@@ -44,7 +44,7 @@ public class JetPropertyAccessor extends JetDeclarationStub<PsiJetPropertyAccess
}
public boolean isSetter() {
PsiJetPropertyAccessorStub stub = getStub();
KotlinPropertyAccessorStub stub = getStub();
if (stub != null) {
return !stub.isGetter();
}
@@ -52,7 +52,7 @@ public class JetPropertyAccessor extends JetDeclarationStub<PsiJetPropertyAccess
}
public boolean isGetter() {
PsiJetPropertyAccessorStub stub = getStub();
KotlinPropertyAccessorStub stub = getStub();
if (stub != null) {
return stub.isGetter();
}
@@ -91,7 +91,7 @@ public class JetPropertyAccessor extends JetDeclarationStub<PsiJetPropertyAccess
@Override
public boolean hasBody() {
PsiJetPropertyAccessorStub stub = getStub();
KotlinPropertyAccessorStub stub = getStub();
if (stub != null) {
return stub.hasBody();
}
@@ -18,17 +18,17 @@ package org.jetbrains.jet.lang.psi;
import com.intellij.lang.ASTNode;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.stubs.PsiJetPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import java.util.List;
public class JetTypeArgumentList extends JetElementImplStub<PsiJetPlaceHolderStub<JetTypeArgumentList>> {
public class JetTypeArgumentList extends JetElementImplStub<KotlinPlaceHolderStub<JetTypeArgumentList>> {
public JetTypeArgumentList(@NotNull ASTNode node) {
super(node);
}
public JetTypeArgumentList(@NotNull PsiJetPlaceHolderStub<JetTypeArgumentList> stub) {
public JetTypeArgumentList(@NotNull KotlinPlaceHolderStub<JetTypeArgumentList> stub) {
super(stub, JetStubElementTypes.TYPE_ARGUMENT_LIST);
}
@@ -19,16 +19,16 @@ 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.lang.psi.stubs.PsiJetTypeConstraintStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinTypeConstraintStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import org.jetbrains.jet.lexer.JetTokens;
public class JetTypeConstraint extends JetElementImplStub<PsiJetTypeConstraintStub> {
public class JetTypeConstraint extends JetElementImplStub<KotlinTypeConstraintStub> {
public JetTypeConstraint(@NotNull ASTNode node) {
super(node);
}
public JetTypeConstraint(@NotNull PsiJetTypeConstraintStub stub) {
public JetTypeConstraint(@NotNull KotlinTypeConstraintStub stub) {
super(stub, JetStubElementTypes.TYPE_CONSTRAINT);
}
@@ -38,7 +38,7 @@ public class JetTypeConstraint extends JetElementImplStub<PsiJetTypeConstraintSt
}
public boolean isClassObjectConstraint() {
PsiJetTypeConstraintStub stub = getStub();
KotlinTypeConstraintStub stub = getStub();
if (stub != null) {
return stub.isClassObjectConstraint();
}
@@ -18,18 +18,17 @@ package org.jetbrains.jet.lang.psi;
import com.intellij.lang.ASTNode;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.JetNodeTypes;
import org.jetbrains.jet.lang.psi.stubs.PsiJetPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import java.util.List;
public class JetTypeConstraintList extends JetElementImplStub<PsiJetPlaceHolderStub<JetTypeConstraintList>> {
public class JetTypeConstraintList extends JetElementImplStub<KotlinPlaceHolderStub<JetTypeConstraintList>> {
public JetTypeConstraintList(@NotNull ASTNode node) {
super(node);
}
public JetTypeConstraintList(@NotNull PsiJetPlaceHolderStub<JetTypeConstraintList> stub) {
public JetTypeConstraintList(@NotNull KotlinPlaceHolderStub<JetTypeConstraintList> stub) {
super(stub, JetStubElementTypes.TYPE_CONSTRAINT_LIST);
}
@@ -19,18 +19,18 @@ 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.lang.psi.stubs.PsiJetTypeParameterStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinTypeParameterStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import org.jetbrains.jet.lang.types.Variance;
import org.jetbrains.jet.lexer.JetTokens;
public class JetTypeParameter extends JetNamedDeclarationStub<PsiJetTypeParameterStub> {
public class JetTypeParameter extends JetNamedDeclarationStub<KotlinTypeParameterStub> {
public JetTypeParameter(@NotNull ASTNode node) {
super(node);
}
public JetTypeParameter(@NotNull PsiJetTypeParameterStub stub) {
public JetTypeParameter(@NotNull KotlinTypeParameterStub stub) {
super(stub, JetStubElementTypes.TYPE_PARAMETER);
}
@@ -41,7 +41,7 @@ public class JetTypeParameter extends JetNamedDeclarationStub<PsiJetTypeParamete
@NotNull
public Variance getVariance() {
PsiJetTypeParameterStub stub = getStub();
KotlinTypeParameterStub stub = getStub();
if (stub != null) {
if (stub.isOutVariance()) return Variance.OUT_VARIANCE;
if (stub.isInVariance()) return Variance.IN_VARIANCE;
@@ -18,17 +18,17 @@ package org.jetbrains.jet.lang.psi;
import com.intellij.lang.ASTNode;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.stubs.PsiJetPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import java.util.List;
public class JetTypeParameterList extends JetElementImplStub<PsiJetPlaceHolderStub<JetTypeParameterList>> {
public class JetTypeParameterList extends JetElementImplStub<KotlinPlaceHolderStub<JetTypeParameterList>> {
public JetTypeParameterList(@NotNull ASTNode node) {
super(node);
}
public JetTypeParameterList(@NotNull PsiJetPlaceHolderStub<JetTypeParameterList> stub) {
public JetTypeParameterList(@NotNull KotlinPlaceHolderStub<JetTypeParameterList> stub) {
super(stub, JetStubElementTypes.TYPE_PARAMETER_LIST);
}
@@ -20,13 +20,13 @@ import com.intellij.lang.ASTNode;
import com.intellij.psi.stubs.IStubElementType;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.psi.stubs.PsiJetStubWithFqName;
import org.jetbrains.jet.lang.psi.stubs.KotlinStubWithFqName;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import java.util.Collections;
import java.util.List;
abstract class JetTypeParameterListOwnerStub<T extends PsiJetStubWithFqName> extends JetNamedDeclarationStub<T> implements JetTypeParameterListOwner {
abstract class JetTypeParameterListOwnerStub<T extends KotlinStubWithFqName> extends JetNamedDeclarationStub<T> implements JetTypeParameterListOwner {
public JetTypeParameterListOwnerStub(@NotNull T stub, @NotNull IStubElementType nodeType) {
super(stub, nodeType);
}
@@ -21,23 +21,23 @@ import com.intellij.psi.PsiElement;
import com.intellij.psi.tree.IElementType;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.psi.stubs.PsiJetTypeProjectionStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinTypeProjectionStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import org.jetbrains.jet.lexer.JetTokens;
public class JetTypeProjection extends JetModifierListOwnerStub<PsiJetTypeProjectionStub> {
public class JetTypeProjection extends JetModifierListOwnerStub<KotlinTypeProjectionStub> {
public JetTypeProjection(@NotNull ASTNode node) {
super(node);
}
public JetTypeProjection(@NotNull PsiJetTypeProjectionStub stub) {
public JetTypeProjection(@NotNull KotlinTypeProjectionStub stub) {
super(stub, JetStubElementTypes.TYPE_PROJECTION);
}
@NotNull
public JetProjectionKind getProjectionKind() {
PsiJetTypeProjectionStub stub = getStub();
KotlinTypeProjectionStub stub = getStub();
if (stub != null) {
return stub.getProjectionKind();
}
@@ -19,7 +19,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.lang.psi.stubs.PsiJetPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import java.util.ArrayList;
@@ -32,13 +32,13 @@ import static org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes.ANNO
* Type reference element.
* Underlying token is {@link org.jetbrains.jet.JetNodeTypes#TYPE_REFERENCE}
*/
public class JetTypeReference extends JetElementImplStub<PsiJetPlaceHolderStub<JetTypeReference>> {
public class JetTypeReference extends JetElementImplStub<KotlinPlaceHolderStub<JetTypeReference>> {
public JetTypeReference(@NotNull ASTNode node) {
super(node);
}
public JetTypeReference(PsiJetPlaceHolderStub<JetTypeReference> stub) {
public JetTypeReference(KotlinPlaceHolderStub<JetTypeReference> stub) {
super(stub, JetStubElementTypes.TYPE_REFERENCE);
}
@@ -20,25 +20,24 @@ import com.google.common.collect.Lists;
import com.intellij.lang.ASTNode;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.JetNodeTypes;
import org.jetbrains.jet.lang.psi.stubs.PsiJetUserTypeStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinUserTypeStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import org.jetbrains.jet.lexer.JetTokens;
import java.util.Collections;
import java.util.List;
public class JetUserType extends JetElementImplStub<PsiJetUserTypeStub> implements JetTypeElement {
public class JetUserType extends JetElementImplStub<KotlinUserTypeStub> implements JetTypeElement {
public JetUserType(@NotNull ASTNode node) {
super(node);
}
public JetUserType(@NotNull PsiJetUserTypeStub stub) {
public JetUserType(@NotNull KotlinUserTypeStub stub) {
super(stub, JetStubElementTypes.USER_TYPE);
}
public boolean isAbsoluteInRootPackage() {
PsiJetUserTypeStub stub = getStub();
KotlinUserTypeStub stub = getStub();
if (stub != null) {
return stub.isAbsoluteInRootPackage();
}
@@ -32,7 +32,7 @@ import com.intellij.psi.PsiParameter
import com.intellij.psi.PsiPackage
import com.intellij.psi.JavaDirectoryService
import com.intellij.psi.PsiDirectory
import org.jetbrains.jet.lang.psi.stubs.PsiJetClassOrObjectStub
import org.jetbrains.jet.lang.psi.stubs.KotlinClassOrObjectStub
import org.jetbrains.jet.lang.types.expressions.OperatorConventions
import org.jetbrains.jet.lang.diagnostics.DiagnosticUtils
import com.intellij.psi.PsiWhiteSpace
@@ -126,7 +126,7 @@ public fun JetElement.wrapInBlock(): JetBlockExpression {
*
* @return the list of possible superclass names
*/
public fun <T: JetClassOrObject> StubBasedPsiElementBase<out PsiJetClassOrObjectStub<T>>.getSuperNames(): List<String> {
public fun <T: JetClassOrObject> StubBasedPsiElementBase<out KotlinClassOrObjectStub<T>>.getSuperNames(): List<String> {
fun addSuperName(result: MutableList<String>, referencedName: String): Unit {
result.add(referencedName)
@@ -20,7 +20,7 @@ import com.intellij.psi.stubs.StubElement;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetAnnotationEntry;
public interface PsiJetAnnotationEntryStub extends StubElement<JetAnnotationEntry> {
public interface KotlinAnnotationEntryStub extends StubElement<JetAnnotationEntry> {
@NotNull
String getShortName();
@@ -21,7 +21,7 @@ import org.jetbrains.jet.lang.psi.JetClassOrObject;
import java.util.List;
public interface PsiJetClassOrObjectStub<T extends JetClassOrObject> extends PsiJetStubWithFqName<T> {
public interface KotlinClassOrObjectStub<T extends JetClassOrObject> extends KotlinStubWithFqName<T> {
boolean isLocal();
@NotNull
@@ -18,7 +18,7 @@ package org.jetbrains.jet.lang.psi.stubs;
import org.jetbrains.jet.lang.psi.JetClass;
public interface PsiJetClassStub extends PsiJetClassOrObjectStub<JetClass> {
public interface KotlinClassStub extends KotlinClassOrObjectStub<JetClass> {
boolean isTrait();
boolean isEnumEntry();
@@ -21,7 +21,7 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetFile;
import org.jetbrains.jet.lang.resolve.name.FqName;
public interface PsiJetFileStub extends PsiFileStub<JetFile> {
public interface KotlinFileStub extends PsiFileStub<JetFile> {
@NotNull
FqName getPackageFqName();
boolean isScript();
@@ -16,10 +16,9 @@
package org.jetbrains.jet.lang.psi.stubs;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetNamedFunction;
public interface PsiJetFunctionStub extends PsiJetStubWithFqName<JetNamedFunction> {
public interface KotlinFunctionStub extends KotlinStubWithFqName<JetNamedFunction> {
boolean isTopLevel();
boolean isExtension();
@@ -21,7 +21,7 @@ import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.psi.JetImportDirective;
import org.jetbrains.jet.lang.resolve.name.Name;
public interface PsiJetImportDirectiveStub extends StubElement<JetImportDirective> {
public interface KotlinImportDirectiveStub extends StubElement<JetImportDirective> {
boolean isAbsoluteInRootPackage();
boolean isAllUnder();
@Nullable
@@ -21,6 +21,6 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetModifierList;
import org.jetbrains.jet.lexer.JetModifierKeywordToken;
public interface PsiJetModifierListStub extends StubElement<JetModifierList> {
public interface KotlinModifierListStub extends StubElement<JetModifierList> {
boolean hasModifier(@NotNull JetModifierKeywordToken modifierToken);
}
@@ -21,7 +21,7 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetNameReferenceExpression;
import org.jetbrains.jet.lang.resolve.name.Name;
public interface PsiJetNameReferenceExpressionStub extends StubElement<JetNameReferenceExpression> {
public interface KotlinNameReferenceExpressionStub extends StubElement<JetNameReferenceExpression> {
@NotNull
String getReferencedName();
}
@@ -18,7 +18,7 @@ package org.jetbrains.jet.lang.psi.stubs;
import org.jetbrains.jet.lang.psi.JetObjectDeclaration;
public interface PsiJetObjectStub extends PsiJetClassOrObjectStub<JetObjectDeclaration> {
public interface KotlinObjectStub extends KotlinClassOrObjectStub<JetObjectDeclaration> {
boolean isClassObject();
boolean isObjectLiteral();
}
@@ -18,7 +18,7 @@ package org.jetbrains.jet.lang.psi.stubs;
import org.jetbrains.jet.lang.psi.JetParameter;
public interface PsiJetParameterStub extends PsiJetStubWithFqName<JetParameter> {
public interface KotlinParameterStub extends KotlinStubWithFqName<JetParameter> {
boolean isMutable();
boolean hasValOrValNode();
boolean hasDefaultValue();
@@ -19,5 +19,5 @@ package org.jetbrains.jet.lang.psi.stubs;
import com.intellij.psi.stubs.StubElement;
import org.jetbrains.jet.lang.psi.JetElement;
public interface PsiJetPlaceHolderStub<T extends JetElement> extends StubElement<T> {
public interface KotlinPlaceHolderStub<T extends JetElement> extends StubElement<T> {
}
@@ -19,7 +19,7 @@ package org.jetbrains.jet.lang.psi.stubs;
import com.intellij.psi.stubs.StubElement;
import org.jetbrains.jet.lang.psi.JetPropertyAccessor;
public interface PsiJetPropertyAccessorStub extends StubElement<JetPropertyAccessor> {
public interface KotlinPropertyAccessorStub extends StubElement<JetPropertyAccessor> {
boolean isGetter();
boolean hasBody();
boolean hasBlockBody();
@@ -18,7 +18,7 @@ package org.jetbrains.jet.lang.psi.stubs;
import org.jetbrains.jet.lang.psi.JetProperty;
public interface PsiJetPropertyStub extends PsiJetStubWithFqName<JetProperty> {
public interface KotlinPropertyStub extends KotlinStubWithFqName<JetProperty> {
boolean isVar();
boolean isTopLevel();
boolean hasDelegate();
@@ -21,7 +21,7 @@ import com.intellij.psi.stubs.NamedStub;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.resolve.name.FqName;
public interface PsiJetStubWithFqName<T extends PsiNamedElement> extends NamedStub<T> {
public interface KotlinStubWithFqName<T extends PsiNamedElement> extends NamedStub<T> {
@Nullable
FqName getFqName();
}
@@ -19,6 +19,6 @@ package org.jetbrains.jet.lang.psi.stubs;
import com.intellij.psi.stubs.StubElement;
import org.jetbrains.jet.lang.psi.JetTypeConstraint;
public interface PsiJetTypeConstraintStub extends StubElement<JetTypeConstraint> {
public interface KotlinTypeConstraintStub extends StubElement<JetTypeConstraint> {
boolean isClassObjectConstraint();
}
@@ -18,7 +18,7 @@ package org.jetbrains.jet.lang.psi.stubs;
import org.jetbrains.jet.lang.psi.JetTypeParameter;
public interface PsiJetTypeParameterStub extends PsiJetStubWithFqName<JetTypeParameter> {
public interface KotlinTypeParameterStub extends KotlinStubWithFqName<JetTypeParameter> {
boolean isInVariance();
boolean isOutVariance();
}
@@ -20,6 +20,6 @@ import com.intellij.psi.stubs.StubElement;
import org.jetbrains.jet.lang.psi.JetProjectionKind;
import org.jetbrains.jet.lang.psi.JetTypeProjection;
public interface PsiJetTypeProjectionStub extends StubElement<JetTypeProjection> {
public interface KotlinTypeProjectionStub extends StubElement<JetTypeProjection> {
JetProjectionKind getProjectionKind();
}
@@ -21,6 +21,6 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetUserType;
import org.jetbrains.jet.lang.resolve.name.Name;
public interface PsiJetUserTypeStub extends StubElement<JetUserType> {
public interface KotlinUserTypeStub extends StubElement<JetUserType> {
boolean isAbsoluteInRootPackage();
}
@@ -25,42 +25,42 @@ import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetAnnotationEntry;
import org.jetbrains.jet.lang.psi.JetPsiUtil;
import org.jetbrains.jet.lang.psi.stubs.PsiJetAnnotationEntryStub;
import org.jetbrains.jet.lang.psi.stubs.impl.PsiJetAnnotationEntryStubImpl;
import org.jetbrains.jet.lang.psi.stubs.KotlinAnnotationEntryStub;
import org.jetbrains.jet.lang.psi.stubs.impl.KotlinAnnotationEntryStubImpl;
import org.jetbrains.jet.lang.resolve.name.Name;
import java.io.IOException;
public class JetAnnotationEntryElementType extends JetStubElementType<PsiJetAnnotationEntryStub, JetAnnotationEntry> {
public class JetAnnotationEntryElementType extends JetStubElementType<KotlinAnnotationEntryStub, JetAnnotationEntry> {
public JetAnnotationEntryElementType(@NotNull @NonNls String debugName) {
super(debugName, JetAnnotationEntry.class, PsiJetAnnotationEntryStub.class);
super(debugName, JetAnnotationEntry.class, KotlinAnnotationEntryStub.class);
}
@Override
public PsiJetAnnotationEntryStub createStub(@NotNull JetAnnotationEntry psi, StubElement parentStub) {
public KotlinAnnotationEntryStub createStub(@NotNull JetAnnotationEntry psi, StubElement parentStub) {
Name shortName = JetPsiUtil.getShortName(psi);
String resultName = shortName != null ? shortName.asString() : psi.getText();
boolean hasValueArguments = psi.getValueArgumentList() != null;
return new PsiJetAnnotationEntryStubImpl(parentStub, StringRef.fromString(resultName), hasValueArguments);
return new KotlinAnnotationEntryStubImpl(parentStub, StringRef.fromString(resultName), hasValueArguments);
}
@Override
public void serialize(@NotNull PsiJetAnnotationEntryStub stub, @NotNull StubOutputStream dataStream) throws IOException {
public void serialize(@NotNull KotlinAnnotationEntryStub stub, @NotNull StubOutputStream dataStream) throws IOException {
dataStream.writeName(stub.getShortName());
dataStream.writeBoolean(stub.hasValueArguments());
}
@NotNull
@Override
public PsiJetAnnotationEntryStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
public KotlinAnnotationEntryStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
StringRef text = dataStream.readName();
boolean hasValueArguments = dataStream.readBoolean();
return new PsiJetAnnotationEntryStubImpl(parentStub, text, hasValueArguments);
return new KotlinAnnotationEntryStubImpl(parentStub, text, hasValueArguments);
}
@Override
public void indexStub(@NotNull PsiJetAnnotationEntryStub stub, @NotNull IndexSink sink) {
public void indexStub(@NotNull KotlinAnnotationEntryStub stub, @NotNull IndexSink sink) {
StubIndexServiceFactory.getInstance().indexAnnotation(stub, sink);
}
}
@@ -27,8 +27,8 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetClass;
import org.jetbrains.jet.lang.psi.JetEnumEntry;
import org.jetbrains.jet.lang.psi.psiUtil.PsiUtilPackage;
import org.jetbrains.jet.lang.psi.stubs.PsiJetClassStub;
import org.jetbrains.jet.lang.psi.stubs.impl.PsiJetClassStubImpl;
import org.jetbrains.jet.lang.psi.stubs.KotlinClassStub;
import org.jetbrains.jet.lang.psi.stubs.impl.KotlinClassStubImpl;
import org.jetbrains.jet.lang.psi.stubs.impl.Utils;
import org.jetbrains.jet.lang.resolve.lazy.ResolveSessionUtils;
import org.jetbrains.jet.lang.resolve.name.FqName;
@@ -36,14 +36,14 @@ import org.jetbrains.jet.lang.resolve.name.FqName;
import java.io.IOException;
import java.util.List;
public class JetClassElementType extends JetStubElementType<PsiJetClassStub, JetClass> {
public class JetClassElementType extends JetStubElementType<KotlinClassStub, JetClass> {
public JetClassElementType(@NotNull @NonNls String debugName) {
super(debugName, JetClass.class, PsiJetClassStub.class);
super(debugName, JetClass.class, KotlinClassStub.class);
}
@NotNull
@Override
public JetClass createPsi(@NotNull PsiJetClassStub stub) {
public JetClass createPsi(@NotNull KotlinClassStub stub) {
return !stub.isEnumEntry() ? new JetClass(stub) : new JetEnumEntry(stub);
}
@@ -54,18 +54,18 @@ public class JetClassElementType extends JetStubElementType<PsiJetClassStub, Jet
}
@Override
public PsiJetClassStub createStub(@NotNull JetClass psi, StubElement parentStub) {
public KotlinClassStub createStub(@NotNull JetClass psi, StubElement parentStub) {
FqName fqName = ResolveSessionUtils.safeFqNameForLazyResolve(psi);
boolean isEnumEntry = psi instanceof JetEnumEntry;
List<String> superNames = PsiUtilPackage.getSuperNames(psi);
return new PsiJetClassStubImpl(
return new KotlinClassStubImpl(
getStubType(isEnumEntry), parentStub, StringRef.fromString(fqName != null ? fqName.asString() : null),
StringRef.fromString(psi.getName()), Utils.INSTANCE$.wrapStrings(superNames), psi.isTrait(), isEnumEntry,
psi.isLocal(), psi.isTopLevel());
}
@Override
public void serialize(@NotNull PsiJetClassStub stub, @NotNull StubOutputStream dataStream) throws IOException {
public void serialize(@NotNull KotlinClassStub stub, @NotNull StubOutputStream dataStream) throws IOException {
dataStream.writeName(stub.getName());
FqName fqName = stub.getFqName();
dataStream.writeName(fqName == null ? null : fqName.asString());
@@ -83,7 +83,7 @@ public class JetClassElementType extends JetStubElementType<PsiJetClassStub, Jet
@NotNull
@Override
public PsiJetClassStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
public KotlinClassStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
StringRef name = dataStream.readName();
StringRef qualifiedName = dataStream.readName();
boolean isTrait = dataStream.readBoolean();
@@ -97,12 +97,12 @@ public class JetClassElementType extends JetStubElementType<PsiJetClassStub, Jet
superNames[i] = dataStream.readName();
}
return new PsiJetClassStubImpl(getStubType(isEnumEntry), parentStub, qualifiedName, name, superNames,
return new KotlinClassStubImpl(getStubType(isEnumEntry), parentStub, qualifiedName, name, superNames,
isTrait, isEnumEntry, isLocal, isTopLevel);
}
@Override
public void indexStub(@NotNull PsiJetClassStub stub, @NotNull IndexSink sink) {
public void indexStub(@NotNull KotlinClassStub stub, @NotNull IndexSink sink) {
StubIndexServiceFactory.getInstance().indexClass(stub, sink);
}
@@ -29,13 +29,13 @@ import com.intellij.util.io.StringRef;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.parsing.JetParser;
import org.jetbrains.jet.lang.psi.stubs.PsiJetFileStub;
import org.jetbrains.jet.lang.psi.stubs.impl.PsiJetFileStubImpl;
import org.jetbrains.jet.lang.psi.stubs.KotlinFileStub;
import org.jetbrains.jet.lang.psi.stubs.impl.KotlinFileStubImpl;
import org.jetbrains.jet.plugin.JetLanguage;
import java.io.IOException;
public class JetFileElementType extends IStubFileElementType<PsiJetFileStub> {
public class JetFileElementType extends IStubFileElementType<KotlinFileStub> {
public static final int STUB_VERSION = 30;
public JetFileElementType() {
@@ -63,7 +63,7 @@ public class JetFileElementType extends IStubFileElementType<PsiJetFileStub> {
}
@Override
public void serialize(@NotNull PsiJetFileStub stub, @NotNull StubOutputStream dataStream)
public void serialize(@NotNull KotlinFileStub stub, @NotNull StubOutputStream dataStream)
throws IOException {
dataStream.writeName(stub.getPackageFqName().asString());
dataStream.writeBoolean(stub.isScript());
@@ -71,10 +71,10 @@ public class JetFileElementType extends IStubFileElementType<PsiJetFileStub> {
@NotNull
@Override
public PsiJetFileStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
public KotlinFileStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
StringRef packageFqNameAsString = dataStream.readName();
boolean isScript = dataStream.readBoolean();
return new PsiJetFileStubImpl(null, packageFqNameAsString, isScript);
return new KotlinFileStubImpl(null, packageFqNameAsString, isScript);
}
@Override
@@ -87,7 +87,7 @@ public class JetFileElementType extends IStubFileElementType<PsiJetFileStub> {
}
@Override
public void indexStub(@NotNull PsiJetFileStub stub, @NotNull IndexSink sink) {
public void indexStub(@NotNull KotlinFileStub stub, @NotNull IndexSink sink) {
StubIndexServiceFactory.getInstance().indexFile(stub, sink);
}
}
@@ -21,7 +21,7 @@ import com.intellij.psi.stubs.DefaultStubBuilder;
import com.intellij.psi.stubs.StubElement;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetFile;
import org.jetbrains.jet.lang.psi.stubs.impl.PsiJetFileStubImpl;
import org.jetbrains.jet.lang.psi.stubs.impl.KotlinFileStubImpl;
public class JetFileStubBuilder extends DefaultStubBuilder {
@Override
@@ -31,6 +31,6 @@ public class JetFileStubBuilder extends DefaultStubBuilder {
}
JetFile jetFile = (JetFile) file;
return new PsiJetFileStubImpl(jetFile, jetFile.getPackageFqNameByTree().asString(), jetFile.isScriptByTree());
return new KotlinFileStubImpl(jetFile, jetFile.getPackageFqNameByTree().asString(), jetFile.isScriptByTree());
}
}
@@ -25,32 +25,32 @@ import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetFile;
import org.jetbrains.jet.lang.psi.JetNamedFunction;
import org.jetbrains.jet.lang.psi.stubs.PsiJetFunctionStub;
import org.jetbrains.jet.lang.psi.stubs.impl.PsiJetFunctionStubImpl;
import org.jetbrains.jet.lang.psi.stubs.KotlinFunctionStub;
import org.jetbrains.jet.lang.psi.stubs.impl.KotlinFunctionStubImpl;
import org.jetbrains.jet.lang.resolve.lazy.ResolveSessionUtils;
import org.jetbrains.jet.lang.resolve.name.FqName;
import java.io.IOException;
public class JetFunctionElementType extends JetStubElementType<PsiJetFunctionStub, JetNamedFunction> {
public class JetFunctionElementType extends JetStubElementType<KotlinFunctionStub, JetNamedFunction> {
public JetFunctionElementType(@NotNull @NonNls String debugName) {
super(debugName, JetNamedFunction.class, PsiJetFunctionStub.class);
super(debugName, JetNamedFunction.class, KotlinFunctionStub.class);
}
@Override
public PsiJetFunctionStub createStub(@NotNull JetNamedFunction psi, @NotNull StubElement parentStub) {
public KotlinFunctionStub createStub(@NotNull JetNamedFunction psi, @NotNull StubElement parentStub) {
boolean isTopLevel = psi.getParent() instanceof JetFile;
boolean isExtension = psi.getReceiverTypeReference() != null;
FqName fqName = ResolveSessionUtils.safeFqNameForLazyResolve(psi);
boolean hasBlockBody = psi.hasBlockBody();
boolean hasBody = psi.hasBody();
return new PsiJetFunctionStubImpl(parentStub, StringRef.fromString(psi.getName()), isTopLevel, fqName,
return new KotlinFunctionStubImpl(parentStub, StringRef.fromString(psi.getName()), isTopLevel, fqName,
isExtension, hasBlockBody, hasBody, psi.hasTypeParameterListBeforeFunctionName());
}
@Override
public void serialize(@NotNull PsiJetFunctionStub stub, @NotNull StubOutputStream dataStream) throws IOException {
public void serialize(@NotNull KotlinFunctionStub stub, @NotNull StubOutputStream dataStream) throws IOException {
dataStream.writeName(stub.getName());
dataStream.writeBoolean(stub.isTopLevel());
@@ -65,7 +65,7 @@ public class JetFunctionElementType extends JetStubElementType<PsiJetFunctionStu
@NotNull
@Override
public PsiJetFunctionStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
public KotlinFunctionStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
StringRef name = dataStream.readName();
boolean isTopLevel = dataStream.readBoolean();
@@ -77,12 +77,12 @@ public class JetFunctionElementType extends JetStubElementType<PsiJetFunctionStu
boolean hasBody = dataStream.readBoolean();
boolean hasTypeParameterListBeforeFunctionName = dataStream.readBoolean();
return new PsiJetFunctionStubImpl(parentStub, name, isTopLevel, fqName, isExtension, hasBlockBody, hasBody,
return new KotlinFunctionStubImpl(parentStub, name, isTopLevel, fqName, isExtension, hasBlockBody, hasBody,
hasTypeParameterListBeforeFunctionName);
}
@Override
public void indexStub(@NotNull PsiJetFunctionStub stub, @NotNull IndexSink sink) {
public void indexStub(@NotNull KotlinFunctionStub stub, @NotNull IndexSink sink) {
StubIndexServiceFactory.getInstance().indexFunction(stub, sink);
}
}
@@ -23,25 +23,25 @@ import com.intellij.util.io.StringRef;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetImportDirective;
import org.jetbrains.jet.lang.psi.stubs.PsiJetImportDirectiveStub;
import org.jetbrains.jet.lang.psi.stubs.impl.PsiJetImportDirectiveStubImpl;
import org.jetbrains.jet.lang.psi.stubs.KotlinImportDirectiveStub;
import org.jetbrains.jet.lang.psi.stubs.impl.KotlinImportDirectiveStubImpl;
import java.io.IOException;
public class JetImportDirectiveElementType extends JetStubElementType<PsiJetImportDirectiveStub, JetImportDirective> {
public class JetImportDirectiveElementType extends JetStubElementType<KotlinImportDirectiveStub, JetImportDirective> {
public JetImportDirectiveElementType(@NotNull @NonNls String debugName) {
super(debugName, JetImportDirective.class, PsiJetImportDirectiveStub.class);
super(debugName, JetImportDirective.class, KotlinImportDirectiveStub.class);
}
@Override
public PsiJetImportDirectiveStub createStub(@NotNull JetImportDirective psi, StubElement parentStub) {
public KotlinImportDirectiveStub createStub(@NotNull JetImportDirective psi, StubElement parentStub) {
StringRef aliasName = StringRef.fromString(psi.getAliasName());
return new PsiJetImportDirectiveStubImpl(parentStub, psi.isAbsoluteInRootPackage(), psi.isAllUnder(),
return new KotlinImportDirectiveStubImpl(parentStub, psi.isAbsoluteInRootPackage(), psi.isAllUnder(),
aliasName, psi.isValidImport());
}
@Override
public void serialize(@NotNull PsiJetImportDirectiveStub stub, @NotNull StubOutputStream dataStream) throws IOException {
public void serialize(@NotNull KotlinImportDirectiveStub stub, @NotNull StubOutputStream dataStream) throws IOException {
dataStream.writeBoolean(stub.isAbsoluteInRootPackage());
dataStream.writeBoolean(stub.isAllUnder());
dataStream.writeName(stub.getAliasName());
@@ -50,11 +50,11 @@ public class JetImportDirectiveElementType extends JetStubElementType<PsiJetImpo
@NotNull
@Override
public PsiJetImportDirectiveStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
public KotlinImportDirectiveStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
boolean isAbsoluteInRootPackage = dataStream.readBoolean();
boolean isAllUnder = dataStream.readBoolean();
StringRef aliasName = dataStream.readName();
boolean isValid = dataStream.readBoolean();
return new PsiJetImportDirectiveStubImpl(parentStub, isAbsoluteInRootPackage, isAllUnder, aliasName, isValid);
return new KotlinImportDirectiveStubImpl(parentStub, isAbsoluteInRootPackage, isAllUnder, aliasName, isValid);
}
}
@@ -22,33 +22,33 @@ import com.intellij.psi.stubs.StubOutputStream;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetModifierList;
import org.jetbrains.jet.lang.psi.stubs.PsiJetModifierListStub;
import org.jetbrains.jet.lang.psi.stubs.impl.PsiJetModifierListStubImpl;
import org.jetbrains.jet.lang.psi.stubs.KotlinModifierListStub;
import org.jetbrains.jet.lang.psi.stubs.impl.KotlinModifierListStubImpl;
import java.io.IOException;
import static org.jetbrains.jet.lang.psi.stubs.impl.PsiJetModifierListStubImpl.computeMaskFromPsi;
import static org.jetbrains.jet.lang.psi.stubs.impl.KotlinModifierListStubImpl.computeMaskFromPsi;
public class JetModifierListElementType<T extends JetModifierList> extends JetStubElementType<PsiJetModifierListStub, T> {
public class JetModifierListElementType<T extends JetModifierList> extends JetStubElementType<KotlinModifierListStub, T> {
public JetModifierListElementType(@NotNull @NonNls String debugName, @NotNull Class<T> psiClass) {
super(debugName, psiClass, PsiJetModifierListStub.class);
super(debugName, psiClass, KotlinModifierListStub.class);
}
@Override
public PsiJetModifierListStub createStub(@NotNull T psi, StubElement parentStub) {
return new PsiJetModifierListStubImpl(parentStub, computeMaskFromPsi(psi), this);
public KotlinModifierListStub createStub(@NotNull T psi, StubElement parentStub) {
return new KotlinModifierListStubImpl(parentStub, computeMaskFromPsi(psi), this);
}
@Override
public void serialize(@NotNull PsiJetModifierListStub stub, @NotNull StubOutputStream dataStream) throws IOException {
int mask = ((PsiJetModifierListStubImpl) stub).getMask();
public void serialize(@NotNull KotlinModifierListStub stub, @NotNull StubOutputStream dataStream) throws IOException {
int mask = ((KotlinModifierListStubImpl) stub).getMask();
dataStream.writeVarInt(mask);
}
@NotNull
@Override
public PsiJetModifierListStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
public KotlinModifierListStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
int mask = dataStream.readVarInt();
return new PsiJetModifierListStubImpl(parentStub, mask, this);
return new KotlinModifierListStubImpl(parentStub, mask, this);
}
}
@@ -23,30 +23,30 @@ import com.intellij.util.io.StringRef;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetNameReferenceExpression;
import org.jetbrains.jet.lang.psi.stubs.PsiJetNameReferenceExpressionStub;
import org.jetbrains.jet.lang.psi.stubs.impl.PsiJetNameReferenceExpressionStubImpl;
import org.jetbrains.jet.lang.psi.stubs.KotlinNameReferenceExpressionStub;
import org.jetbrains.jet.lang.psi.stubs.impl.KotlinNameReferenceExpressionStubImpl;
import java.io.IOException;
public class JetNameReferenceExpressionElementType extends JetStubElementType<PsiJetNameReferenceExpressionStub, JetNameReferenceExpression> {
public class JetNameReferenceExpressionElementType extends JetStubElementType<KotlinNameReferenceExpressionStub, JetNameReferenceExpression> {
public JetNameReferenceExpressionElementType(@NotNull @NonNls String debugName) {
super(debugName, JetNameReferenceExpression.class, PsiJetNameReferenceExpressionStub.class);
super(debugName, JetNameReferenceExpression.class, KotlinNameReferenceExpressionStub.class);
}
@Override
public PsiJetNameReferenceExpressionStub createStub(@NotNull JetNameReferenceExpression psi, StubElement parentStub) {
return new PsiJetNameReferenceExpressionStubImpl(parentStub, StringRef.fromString(psi.getReferencedName()));
public KotlinNameReferenceExpressionStub createStub(@NotNull JetNameReferenceExpression psi, StubElement parentStub) {
return new KotlinNameReferenceExpressionStubImpl(parentStub, StringRef.fromString(psi.getReferencedName()));
}
@Override
public void serialize(@NotNull PsiJetNameReferenceExpressionStub stub, @NotNull StubOutputStream dataStream) throws IOException {
public void serialize(@NotNull KotlinNameReferenceExpressionStub stub, @NotNull StubOutputStream dataStream) throws IOException {
dataStream.writeName(stub.getReferencedName());
}
@NotNull
@Override
public PsiJetNameReferenceExpressionStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
public KotlinNameReferenceExpressionStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
StringRef referencedName = dataStream.readName();
return new PsiJetNameReferenceExpressionStubImpl(parentStub, referencedName);
return new KotlinNameReferenceExpressionStubImpl(parentStub, referencedName);
}
}
@@ -16,7 +16,6 @@
package org.jetbrains.jet.lang.psi.stubs.elements;
import com.intellij.lang.ASTNode;
import com.intellij.psi.stubs.IndexSink;
import com.intellij.psi.stubs.StubElement;
import com.intellij.psi.stubs.StubInputStream;
@@ -26,10 +25,9 @@ import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetClassObject;
import org.jetbrains.jet.lang.psi.JetObjectDeclaration;
import org.jetbrains.jet.lang.psi.JetPsiUtil;
import org.jetbrains.jet.lang.psi.psiUtil.PsiUtilPackage;
import org.jetbrains.jet.lang.psi.stubs.PsiJetObjectStub;
import org.jetbrains.jet.lang.psi.stubs.impl.PsiJetObjectStubImpl;
import org.jetbrains.jet.lang.psi.stubs.KotlinObjectStub;
import org.jetbrains.jet.lang.psi.stubs.impl.KotlinObjectStubImpl;
import org.jetbrains.jet.lang.psi.stubs.impl.Utils;
import org.jetbrains.jet.lang.resolve.lazy.ResolveSessionUtils;
import org.jetbrains.jet.lang.resolve.name.FqName;
@@ -37,22 +35,22 @@ import org.jetbrains.jet.lang.resolve.name.FqName;
import java.io.IOException;
import java.util.List;
public class JetObjectElementType extends JetStubElementType<PsiJetObjectStub, JetObjectDeclaration> {
public class JetObjectElementType extends JetStubElementType<KotlinObjectStub, JetObjectDeclaration> {
public JetObjectElementType(@NotNull @NonNls String debugName) {
super(debugName, JetObjectDeclaration.class, PsiJetObjectStub.class);
super(debugName, JetObjectDeclaration.class, KotlinObjectStub.class);
}
@Override
public PsiJetObjectStub createStub(@NotNull JetObjectDeclaration psi, StubElement parentStub) {
public KotlinObjectStub createStub(@NotNull JetObjectDeclaration psi, StubElement parentStub) {
String name = psi.getName();
FqName fqName = ResolveSessionUtils.safeFqNameForLazyResolve(psi);
List<String> superNames = PsiUtilPackage.getSuperNames(psi);
return new PsiJetObjectStubImpl(parentStub, StringRef.fromString(name), fqName, Utils.INSTANCE$.wrapStrings(superNames),
return new KotlinObjectStubImpl(parentStub, StringRef.fromString(name), fqName, Utils.INSTANCE$.wrapStrings(superNames),
psi.isTopLevel(), isClassObject(psi), psi.isLocal(), psi.isObjectLiteral());
}
@Override
public void serialize(@NotNull PsiJetObjectStub stub, @NotNull StubOutputStream dataStream) throws IOException {
public void serialize(@NotNull KotlinObjectStub stub, @NotNull StubOutputStream dataStream) throws IOException {
dataStream.writeName(stub.getName());
FqName fqName = stub.getFqName();
@@ -72,7 +70,7 @@ public class JetObjectElementType extends JetStubElementType<PsiJetObjectStub, J
@NotNull
@Override
public PsiJetObjectStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
public KotlinObjectStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
StringRef name = dataStream.readName();
StringRef fqNameStr = dataStream.readName();
FqName fqName = fqNameStr != null ? new FqName(fqNameStr.toString()) : null;
@@ -88,11 +86,11 @@ public class JetObjectElementType extends JetStubElementType<PsiJetObjectStub, J
superNames[i] = dataStream.readName();
}
return new PsiJetObjectStubImpl(parentStub, name, fqName, superNames, isTopLevel, isClassObject, isLocal, isObjectLiteral);
return new KotlinObjectStubImpl(parentStub, name, fqName, superNames, isTopLevel, isClassObject, isLocal, isObjectLiteral);
}
@Override
public void indexStub(@NotNull PsiJetObjectStub stub, @NotNull IndexSink sink) {
public void indexStub(@NotNull KotlinObjectStub stub, @NotNull IndexSink sink) {
StubIndexServiceFactory.getInstance().indexObject(stub, sink);
}
@@ -16,8 +16,6 @@
package org.jetbrains.jet.lang.psi.stubs.elements;
import com.intellij.lang.ASTNode;
import com.intellij.psi.PsiElement;
import com.intellij.psi.stubs.StubElement;
import com.intellij.psi.stubs.StubInputStream;
import com.intellij.psi.stubs.StubOutputStream;
@@ -25,27 +23,27 @@ import com.intellij.util.io.StringRef;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetParameter;
import org.jetbrains.jet.lang.psi.stubs.PsiJetParameterStub;
import org.jetbrains.jet.lang.psi.stubs.impl.PsiJetParameterStubImpl;
import org.jetbrains.jet.lang.psi.stubs.KotlinParameterStub;
import org.jetbrains.jet.lang.psi.stubs.impl.KotlinParameterStubImpl;
import org.jetbrains.jet.lang.resolve.name.FqName;
import java.io.IOException;
public class JetParameterElementType extends JetStubElementType<PsiJetParameterStub, JetParameter> {
public class JetParameterElementType extends JetStubElementType<KotlinParameterStub, JetParameter> {
public JetParameterElementType(@NotNull @NonNls String debugName) {
super(debugName, JetParameter.class, PsiJetParameterStub.class);
super(debugName, JetParameter.class, KotlinParameterStub.class);
}
@Override
public PsiJetParameterStub createStub(@NotNull JetParameter psi, StubElement parentStub) {
public KotlinParameterStub createStub(@NotNull JetParameter psi, StubElement parentStub) {
FqName fqName = psi.getFqName();
StringRef fqNameRef = StringRef.fromString(fqName != null ? fqName.asString() : null);
return new PsiJetParameterStubImpl(parentStub, fqNameRef, StringRef.fromString(psi.getName()),
return new KotlinParameterStubImpl(parentStub, fqNameRef, StringRef.fromString(psi.getName()),
psi.isMutable(), psi.hasValOrVarNode(), psi.hasDefaultValue());
}
@Override
public void serialize(@NotNull PsiJetParameterStub stub, @NotNull StubOutputStream dataStream) throws IOException {
public void serialize(@NotNull KotlinParameterStub stub, @NotNull StubOutputStream dataStream) throws IOException {
dataStream.writeName(stub.getName());
dataStream.writeBoolean(stub.isMutable());
dataStream.writeBoolean(stub.hasValOrValNode());
@@ -56,13 +54,13 @@ public class JetParameterElementType extends JetStubElementType<PsiJetParameterS
@NotNull
@Override
public PsiJetParameterStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
public KotlinParameterStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
StringRef name = dataStream.readName();
boolean isMutable = dataStream.readBoolean();
boolean hasValOrValNode = dataStream.readBoolean();
boolean hasDefaultValue = dataStream.readBoolean();
StringRef fqName = dataStream.readName();
return new PsiJetParameterStubImpl(parentStub, fqName, name, isMutable, hasValOrValNode, hasDefaultValue);
return new KotlinParameterStubImpl(parentStub, fqName, name, isMutable, hasValOrValNode, hasDefaultValue);
}
}
@@ -22,30 +22,30 @@ import com.intellij.psi.stubs.StubOutputStream;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetElementImplStub;
import org.jetbrains.jet.lang.psi.stubs.PsiJetPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.impl.PsiJetPlaceHolderStubImpl;
import org.jetbrains.jet.lang.psi.stubs.KotlinPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.impl.KotlinPlaceHolderStubImpl;
import java.io.IOException;
public class JetPlaceHolderStubElementType<T extends JetElementImplStub<? extends StubElement<?>>> extends JetStubElementType<PsiJetPlaceHolderStub<T>, T> {
public class JetPlaceHolderStubElementType<T extends JetElementImplStub<? extends StubElement<?>>> extends JetStubElementType<KotlinPlaceHolderStub<T>, T> {
public JetPlaceHolderStubElementType(@NotNull @NonNls String debugName, @NotNull Class<T> psiClass) {
super(debugName, psiClass, PsiJetPlaceHolderStub.class);
super(debugName, psiClass, KotlinPlaceHolderStub.class);
}
@Override
public PsiJetPlaceHolderStub<T> createStub(@NotNull T psi, StubElement parentStub) {
return new PsiJetPlaceHolderStubImpl<T>(parentStub, this);
public KotlinPlaceHolderStub<T> createStub(@NotNull T psi, StubElement parentStub) {
return new KotlinPlaceHolderStubImpl<T>(parentStub, this);
}
@Override
public void serialize(@NotNull PsiJetPlaceHolderStub<T> stub, @NotNull StubOutputStream dataStream) throws IOException {
public void serialize(@NotNull KotlinPlaceHolderStub<T> stub, @NotNull StubOutputStream dataStream) throws IOException {
//do nothing
}
@NotNull
@Override
public PsiJetPlaceHolderStub<T> deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
return new PsiJetPlaceHolderStubImpl<T>(parentStub, this);
public KotlinPlaceHolderStub<T> deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
return new KotlinPlaceHolderStubImpl<T>(parentStub, this);
}
}
@@ -22,23 +22,23 @@ import com.intellij.psi.stubs.StubOutputStream;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetPropertyAccessor;
import org.jetbrains.jet.lang.psi.stubs.PsiJetPropertyAccessorStub;
import org.jetbrains.jet.lang.psi.stubs.impl.PsiJetPropertyAccessorStubImpl;
import org.jetbrains.jet.lang.psi.stubs.KotlinPropertyAccessorStub;
import org.jetbrains.jet.lang.psi.stubs.impl.KotlinPropertyAccessorStubImpl;
import java.io.IOException;
public class JetPropertyAccessorElementType extends JetStubElementType<PsiJetPropertyAccessorStub, JetPropertyAccessor> {
public class JetPropertyAccessorElementType extends JetStubElementType<KotlinPropertyAccessorStub, JetPropertyAccessor> {
public JetPropertyAccessorElementType(@NotNull @NonNls String debugName) {
super(debugName, JetPropertyAccessor.class, PsiJetPropertyAccessorStub.class);
super(debugName, JetPropertyAccessor.class, KotlinPropertyAccessorStub.class);
}
@Override
public PsiJetPropertyAccessorStub createStub(@NotNull JetPropertyAccessor psi, StubElement parentStub) {
return new PsiJetPropertyAccessorStubImpl(parentStub, psi.isGetter(), psi.hasBody(), psi.hasBlockBody());
public KotlinPropertyAccessorStub createStub(@NotNull JetPropertyAccessor psi, StubElement parentStub) {
return new KotlinPropertyAccessorStubImpl(parentStub, psi.isGetter(), psi.hasBody(), psi.hasBlockBody());
}
@Override
public void serialize(@NotNull PsiJetPropertyAccessorStub stub, @NotNull StubOutputStream dataStream) throws IOException {
public void serialize(@NotNull KotlinPropertyAccessorStub stub, @NotNull StubOutputStream dataStream) throws IOException {
dataStream.writeBoolean(stub.isGetter());
dataStream.writeBoolean(stub.hasBody());
dataStream.writeBoolean(stub.hasBlockBody());
@@ -46,10 +46,10 @@ public class JetPropertyAccessorElementType extends JetStubElementType<PsiJetPro
@NotNull
@Override
public PsiJetPropertyAccessorStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
public KotlinPropertyAccessorStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
boolean isGetter = dataStream.readBoolean();
boolean hasBody = dataStream.readBoolean();
boolean hasBlockBody = dataStream.readBoolean();
return new PsiJetPropertyAccessorStubImpl(parentStub, isGetter, hasBody, hasBlockBody);
return new KotlinPropertyAccessorStubImpl(parentStub, isGetter, hasBody, hasBlockBody);
}
}
@@ -24,25 +24,25 @@ import com.intellij.util.io.StringRef;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetProperty;
import org.jetbrains.jet.lang.psi.stubs.PsiJetPropertyStub;
import org.jetbrains.jet.lang.psi.stubs.impl.PsiJetPropertyStubImpl;
import org.jetbrains.jet.lang.psi.stubs.KotlinPropertyStub;
import org.jetbrains.jet.lang.psi.stubs.impl.KotlinPropertyStubImpl;
import org.jetbrains.jet.lang.resolve.lazy.ResolveSessionUtils;
import org.jetbrains.jet.lang.resolve.name.FqName;
import java.io.IOException;
public class JetPropertyElementType extends JetStubElementType<PsiJetPropertyStub, JetProperty> {
public class JetPropertyElementType extends JetStubElementType<KotlinPropertyStub, JetProperty> {
public JetPropertyElementType(@NotNull @NonNls String debugName) {
super(debugName, JetProperty.class, PsiJetPropertyStub.class);
super(debugName, JetProperty.class, KotlinPropertyStub.class);
}
@Override
public PsiJetPropertyStub createStub(@NotNull JetProperty psi, StubElement parentStub) {
public KotlinPropertyStub createStub(@NotNull JetProperty psi, StubElement parentStub) {
assert !psi.isLocal() :
String.format("Should not store local property: %s, parent %s",
psi.getText(), psi.getParent() != null ? psi.getParent().getText() : "<no parent>");
return new PsiJetPropertyStubImpl(
return new KotlinPropertyStubImpl(
parentStub, StringRef.fromString(psi.getName()),
psi.isVar(), psi.isTopLevel(), psi.hasDelegate(),
psi.hasDelegateExpression(), psi.hasInitializer(),
@@ -52,7 +52,7 @@ public class JetPropertyElementType extends JetStubElementType<PsiJetPropertyStu
}
@Override
public void serialize(@NotNull PsiJetPropertyStub stub, @NotNull StubOutputStream dataStream) throws IOException {
public void serialize(@NotNull KotlinPropertyStub stub, @NotNull StubOutputStream dataStream) throws IOException {
dataStream.writeName(stub.getName());
dataStream.writeBoolean(stub.isVar());
dataStream.writeBoolean(stub.isTopLevel());
@@ -68,7 +68,7 @@ public class JetPropertyElementType extends JetStubElementType<PsiJetPropertyStu
@NotNull
@Override
public PsiJetPropertyStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
public KotlinPropertyStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
StringRef name = dataStream.readName();
boolean isVar = dataStream.readBoolean();
boolean isTopLevel = dataStream.readBoolean();
@@ -81,12 +81,12 @@ public class JetPropertyElementType extends JetStubElementType<PsiJetPropertyStu
StringRef fqNameAsString = dataStream.readName();
FqName fqName = fqNameAsString != null ? new FqName(fqNameAsString.toString()) : null;
return new PsiJetPropertyStubImpl(parentStub, name, isVar, isTopLevel, hasDelegate,
return new KotlinPropertyStubImpl(parentStub, name, isVar, isTopLevel, hasDelegate,
hasDelegateExpression, hasInitializer, hasReceiverTypeRef, hasReturnTypeRef, fqName);
}
@Override
public void indexStub(@NotNull PsiJetPropertyStub stub, @NotNull IndexSink sink) {
public void indexStub(@NotNull KotlinPropertyStub stub, @NotNull IndexSink sink) {
StubIndexServiceFactory.getInstance().indexProperty(stub, sink);
}
}
@@ -22,30 +22,30 @@ import com.intellij.psi.stubs.StubOutputStream;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetTypeConstraint;
import org.jetbrains.jet.lang.psi.stubs.PsiJetTypeConstraintStub;
import org.jetbrains.jet.lang.psi.stubs.impl.PsiJetTypeConstraintImpl;
import org.jetbrains.jet.lang.psi.stubs.KotlinTypeConstraintStub;
import org.jetbrains.jet.lang.psi.stubs.impl.KotlinTypeConstraintImpl;
import java.io.IOException;
public class JetTypeConstraintElementType extends JetStubElementType<PsiJetTypeConstraintStub, JetTypeConstraint> {
public class JetTypeConstraintElementType extends JetStubElementType<KotlinTypeConstraintStub, JetTypeConstraint> {
public JetTypeConstraintElementType(@NotNull @NonNls String debugName) {
super(debugName, JetTypeConstraint.class, PsiJetTypeConstraintStub.class);
super(debugName, JetTypeConstraint.class, KotlinTypeConstraintStub.class);
}
@Override
public PsiJetTypeConstraintStub createStub(@NotNull JetTypeConstraint psi, StubElement parentStub) {
return new PsiJetTypeConstraintImpl(parentStub, psi.isClassObjectConstraint());
public KotlinTypeConstraintStub createStub(@NotNull JetTypeConstraint psi, StubElement parentStub) {
return new KotlinTypeConstraintImpl(parentStub, psi.isClassObjectConstraint());
}
@Override
public void serialize(@NotNull PsiJetTypeConstraintStub stub, @NotNull StubOutputStream dataStream) throws IOException {
public void serialize(@NotNull KotlinTypeConstraintStub stub, @NotNull StubOutputStream dataStream) throws IOException {
dataStream.writeBoolean(stub.isClassObjectConstraint());
}
@NotNull
@Override
public PsiJetTypeConstraintStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
public KotlinTypeConstraintStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
boolean isClassObjectConstraint = dataStream.readBoolean();
return new PsiJetTypeConstraintImpl(parentStub, isClassObjectConstraint);
return new KotlinTypeConstraintImpl(parentStub, isClassObjectConstraint);
}
}
@@ -23,26 +23,25 @@ import com.intellij.util.io.StringRef;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetTypeParameter;
import org.jetbrains.jet.lang.psi.JetTypeReference;
import org.jetbrains.jet.lang.psi.stubs.PsiJetTypeParameterStub;
import org.jetbrains.jet.lang.psi.stubs.impl.PsiJetTypeParameterStubImpl;
import org.jetbrains.jet.lang.psi.stubs.KotlinTypeParameterStub;
import org.jetbrains.jet.lang.psi.stubs.impl.KotlinTypeParameterStubImpl;
import org.jetbrains.jet.lang.types.Variance;
import java.io.IOException;
public class JetTypeParameterElementType extends JetStubElementType<PsiJetTypeParameterStub, JetTypeParameter> {
public class JetTypeParameterElementType extends JetStubElementType<KotlinTypeParameterStub, JetTypeParameter> {
public JetTypeParameterElementType(@NotNull @NonNls String debugName) {
super(debugName, JetTypeParameter.class, PsiJetTypeParameterStub.class);
super(debugName, JetTypeParameter.class, KotlinTypeParameterStub.class);
}
@Override
public PsiJetTypeParameterStub createStub(@NotNull JetTypeParameter psi, StubElement parentStub) {
return new PsiJetTypeParameterStubImpl(parentStub, StringRef.fromString(psi.getName()),
public KotlinTypeParameterStub createStub(@NotNull JetTypeParameter psi, StubElement parentStub) {
return new KotlinTypeParameterStubImpl(parentStub, StringRef.fromString(psi.getName()),
psi.getVariance() == Variance.IN_VARIANCE, psi.getVariance() == Variance.OUT_VARIANCE);
}
@Override
public void serialize(@NotNull PsiJetTypeParameterStub stub, @NotNull StubOutputStream dataStream) throws IOException {
public void serialize(@NotNull KotlinTypeParameterStub stub, @NotNull StubOutputStream dataStream) throws IOException {
dataStream.writeName(stub.getName());
dataStream.writeBoolean(stub.isInVariance());
dataStream.writeBoolean(stub.isOutVariance());
@@ -50,11 +49,11 @@ public class JetTypeParameterElementType extends JetStubElementType<PsiJetTypePa
@NotNull
@Override
public PsiJetTypeParameterStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
public KotlinTypeParameterStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
StringRef name = dataStream.readName();
boolean isInVariance = dataStream.readBoolean();
boolean isOutVariance = dataStream.readBoolean();
return new PsiJetTypeParameterStubImpl(parentStub, name, isInVariance, isOutVariance);
return new KotlinTypeParameterStubImpl(parentStub, name, isInVariance, isOutVariance);
}
}
@@ -22,30 +22,30 @@ import com.intellij.psi.stubs.StubOutputStream;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetTypeProjection;
import org.jetbrains.jet.lang.psi.stubs.PsiJetTypeProjectionStub;
import org.jetbrains.jet.lang.psi.stubs.impl.PsiJetTypeProjectionStubImpl;
import org.jetbrains.jet.lang.psi.stubs.KotlinTypeProjectionStub;
import org.jetbrains.jet.lang.psi.stubs.impl.KotlinTypeProjectionStubImpl;
import java.io.IOException;
public class JetTypeProjectionElementType extends JetStubElementType<PsiJetTypeProjectionStub, JetTypeProjection> {
public class JetTypeProjectionElementType extends JetStubElementType<KotlinTypeProjectionStub, JetTypeProjection> {
public JetTypeProjectionElementType(@NotNull @NonNls String debugName) {
super(debugName, JetTypeProjection.class, PsiJetTypeProjectionStub.class);
super(debugName, JetTypeProjection.class, KotlinTypeProjectionStub.class);
}
@Override
public PsiJetTypeProjectionStub createStub(@NotNull JetTypeProjection psi, StubElement parentStub) {
return new PsiJetTypeProjectionStubImpl(parentStub, psi.getProjectionKind().ordinal());
public KotlinTypeProjectionStub createStub(@NotNull JetTypeProjection psi, StubElement parentStub) {
return new KotlinTypeProjectionStubImpl(parentStub, psi.getProjectionKind().ordinal());
}
@Override
public void serialize(@NotNull PsiJetTypeProjectionStub stub, @NotNull StubOutputStream dataStream) throws IOException {
public void serialize(@NotNull KotlinTypeProjectionStub stub, @NotNull StubOutputStream dataStream) throws IOException {
dataStream.writeVarInt(stub.getProjectionKind().ordinal());
}
@NotNull
@Override
public PsiJetTypeProjectionStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
public KotlinTypeProjectionStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
int projectionKindOrdinal = dataStream.readVarInt();
return new PsiJetTypeProjectionStubImpl(parentStub, projectionKindOrdinal);
return new KotlinTypeProjectionStubImpl(parentStub, projectionKindOrdinal);
}
}
@@ -22,30 +22,30 @@ import com.intellij.psi.stubs.StubOutputStream;
import org.jetbrains.annotations.NonNls;
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.impl.PsiJetUserTypeStubImpl;
import org.jetbrains.jet.lang.psi.stubs.KotlinUserTypeStub;
import org.jetbrains.jet.lang.psi.stubs.impl.KotlinUserTypeStubImpl;
import java.io.IOException;
public class JetUserTypeElementType extends JetStubElementType<PsiJetUserTypeStub, JetUserType> {
public class JetUserTypeElementType extends JetStubElementType<KotlinUserTypeStub, JetUserType> {
public JetUserTypeElementType(@NotNull @NonNls String debugName) {
super(debugName, JetUserType.class, PsiJetUserTypeStub.class);
super(debugName, JetUserType.class, KotlinUserTypeStub.class);
}
@Override
public PsiJetUserTypeStub createStub(@NotNull JetUserType psi, StubElement parentStub) {
return new PsiJetUserTypeStubImpl(parentStub, psi.isAbsoluteInRootPackage());
public KotlinUserTypeStub createStub(@NotNull JetUserType psi, StubElement parentStub) {
return new KotlinUserTypeStubImpl(parentStub, psi.isAbsoluteInRootPackage());
}
@Override
public void serialize(@NotNull PsiJetUserTypeStub stub, @NotNull StubOutputStream dataStream) throws IOException {
public void serialize(@NotNull KotlinUserTypeStub stub, @NotNull StubOutputStream dataStream) throws IOException {
dataStream.writeBoolean(stub.isAbsoluteInRootPackage());
}
@NotNull
@Override
public PsiJetUserTypeStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
public KotlinUserTypeStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
boolean isAbsoluteInRootPackage = dataStream.readBoolean();
return new PsiJetUserTypeStubImpl(parentStub, isAbsoluteInRootPackage);
return new KotlinUserTypeStubImpl(parentStub, isAbsoluteInRootPackage);
}
}
@@ -26,34 +26,34 @@ public interface StubIndexService {
*/
StubIndexService NO_INDEX_SERVICE = new StubIndexService() {
@Override
public void indexFile(PsiJetFileStub stub, IndexSink sink) {
public void indexFile(KotlinFileStub stub, IndexSink sink) {
}
@Override
public void indexClass(PsiJetClassStub stub, IndexSink sink) {
public void indexClass(KotlinClassStub stub, IndexSink sink) {
}
@Override
public void indexFunction(PsiJetFunctionStub stub, IndexSink sink) {
public void indexFunction(KotlinFunctionStub stub, IndexSink sink) {
}
@Override
public void indexObject(PsiJetObjectStub stub, IndexSink sink) {
public void indexObject(KotlinObjectStub stub, IndexSink sink) {
}
@Override
public void indexProperty(PsiJetPropertyStub stub, IndexSink sink) {
public void indexProperty(KotlinPropertyStub stub, IndexSink sink) {
}
@Override
public void indexAnnotation(PsiJetAnnotationEntryStub stub, IndexSink sink) {
public void indexAnnotation(KotlinAnnotationEntryStub stub, IndexSink sink) {
}
};
void indexFile(PsiJetFileStub stub, IndexSink sink);
void indexClass(PsiJetClassStub stub, IndexSink sink);
void indexFunction(PsiJetFunctionStub stub, IndexSink sink);
void indexObject(PsiJetObjectStub stub, IndexSink sink);
void indexProperty(PsiJetPropertyStub stub, IndexSink sink);
void indexAnnotation(PsiJetAnnotationEntryStub stub, IndexSink sink);
void indexFile(KotlinFileStub stub, IndexSink sink);
void indexClass(KotlinClassStub stub, IndexSink sink);
void indexFunction(KotlinFunctionStub stub, IndexSink sink);
void indexObject(KotlinObjectStub stub, IndexSink sink);
void indexProperty(KotlinPropertyStub stub, IndexSink sink);
void indexAnnotation(KotlinAnnotationEntryStub stub, IndexSink sink);
}
@@ -20,14 +20,14 @@ import com.intellij.psi.stubs.StubElement;
import com.intellij.util.io.StringRef;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetAnnotationEntry;
import org.jetbrains.jet.lang.psi.stubs.PsiJetAnnotationEntryStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinAnnotationEntryStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
public class PsiJetAnnotationEntryStubImpl extends JetStubBaseImpl<JetAnnotationEntry> implements PsiJetAnnotationEntryStub {
public class KotlinAnnotationEntryStubImpl extends KotlinStubBaseImpl<JetAnnotationEntry> implements KotlinAnnotationEntryStub {
private final StringRef shortName;
private final boolean hasValueArguments;
public PsiJetAnnotationEntryStubImpl(StubElement parent, @NotNull StringRef shortName, boolean hasValueArguments) {
public KotlinAnnotationEntryStubImpl(StubElement parent, @NotNull StringRef shortName, boolean hasValueArguments) {
super(parent, JetStubElementTypes.ANNOTATION_ENTRY);
this.shortName = shortName;
this.hasValueArguments = hasValueArguments;
@@ -20,14 +20,14 @@ import com.intellij.psi.stubs.StubElement;
import com.intellij.util.io.StringRef;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetClass;
import org.jetbrains.jet.lang.psi.stubs.PsiJetClassStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinClassStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetClassElementType;
import org.jetbrains.jet.lang.resolve.name.FqName;
import java.util.ArrayList;
import java.util.List;
public class PsiJetClassStubImpl extends JetStubBaseImpl<JetClass> implements PsiJetClassStub {
public class KotlinClassStubImpl extends KotlinStubBaseImpl<JetClass> implements KotlinClassStub {
private final StringRef qualifiedName;
private final StringRef name;
private final StringRef[] superNames;
@@ -36,7 +36,7 @@ public class PsiJetClassStubImpl extends JetStubBaseImpl<JetClass> implements Ps
private final boolean isLocal;
private final boolean isTopLevel;
public PsiJetClassStubImpl(
public KotlinClassStubImpl(
JetClassElementType type,
StubElement parent,
StringRef qualifiedName,
@@ -26,25 +26,25 @@ import com.intellij.psi.tree.IStubFileElementType;
import com.intellij.util.io.StringRef;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetFile;
import org.jetbrains.jet.lang.psi.stubs.PsiJetFileStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinFileStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import org.jetbrains.jet.lang.resolve.name.FqName;
import java.util.List;
public class PsiJetFileStubImpl extends PsiFileStubImpl<JetFile> implements PsiJetFileStub, PsiClassHolderFileStub<JetFile> {
public class KotlinFileStubImpl extends PsiFileStubImpl<JetFile> implements KotlinFileStub, PsiClassHolderFileStub<JetFile> {
private final StringRef packageName;
private final boolean isScript;
public PsiJetFileStubImpl(JetFile jetFile, @NotNull StringRef packageName, boolean isScript) {
public KotlinFileStubImpl(JetFile jetFile, @NotNull StringRef packageName, boolean isScript) {
super(jetFile);
this.packageName = packageName;
// SCRIPT: PsiJetFileStubImpl knows about scripting
this.isScript = isScript;
}
public PsiJetFileStubImpl(JetFile jetFile, @NotNull String packageName, boolean isScript) {
public KotlinFileStubImpl(JetFile jetFile, @NotNull String packageName, boolean isScript) {
this(jetFile, StringRef.fromString(packageName), isScript);
}
@@ -21,11 +21,11 @@ import com.intellij.util.io.StringRef;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.psi.JetNamedFunction;
import org.jetbrains.jet.lang.psi.stubs.PsiJetFunctionStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinFunctionStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import org.jetbrains.jet.lang.resolve.name.FqName;
public class PsiJetFunctionStubImpl extends JetStubBaseImpl<JetNamedFunction> implements PsiJetFunctionStub {
public class KotlinFunctionStubImpl extends KotlinStubBaseImpl<JetNamedFunction> implements KotlinFunctionStub {
private final StringRef nameRef;
private final boolean isTopLevel;
@@ -35,7 +35,7 @@ public class PsiJetFunctionStubImpl extends JetStubBaseImpl<JetNamedFunction> im
private final boolean hasBody;
private final boolean hasTypeParameterListBeforeFunctionName;
public PsiJetFunctionStubImpl(
public KotlinFunctionStubImpl(
@NotNull StubElement parent,
@Nullable StringRef nameRef,
boolean isTopLevel,
@@ -20,17 +20,17 @@ import com.intellij.psi.stubs.StubElement;
import com.intellij.util.io.StringRef;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.psi.JetImportDirective;
import org.jetbrains.jet.lang.psi.stubs.PsiJetImportDirectiveStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinImportDirectiveStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
public class PsiJetImportDirectiveStubImpl extends JetStubBaseImpl<JetImportDirective> implements PsiJetImportDirectiveStub {
public class KotlinImportDirectiveStubImpl extends KotlinStubBaseImpl<JetImportDirective> implements KotlinImportDirectiveStub {
private final boolean isAbsoluteInRootPackage;
private final boolean isAllUnder;
@Nullable
private final StringRef aliasName;
private final boolean isValid;
public PsiJetImportDirectiveStubImpl(
public KotlinImportDirectiveStubImpl(
StubElement parent,
boolean isAbsoluteInRootPackage,
boolean isAllUnder,
@@ -20,13 +20,13 @@ import com.intellij.psi.stubs.StubElement;
import com.intellij.util.ArrayUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetModifierList;
import org.jetbrains.jet.lang.psi.stubs.PsiJetModifierListStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinModifierListStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetModifierListElementType;
import org.jetbrains.jet.lexer.JetModifierKeywordToken;
import static org.jetbrains.jet.lexer.JetTokens.MODIFIER_KEYWORDS_ARRAY;
public class PsiJetModifierListStubImpl extends JetStubBaseImpl<JetModifierList> implements PsiJetModifierListStub {
public class KotlinModifierListStubImpl extends KotlinStubBaseImpl<JetModifierList> implements KotlinModifierListStub {
static {
assert MODIFIER_KEYWORDS_ARRAY.length <= 32 : "Current implementation depends on the ability to represent modifier list as bit mask";
@@ -46,7 +46,7 @@ public class PsiJetModifierListStubImpl extends JetStubBaseImpl<JetModifierList>
private final int mask;
public PsiJetModifierListStubImpl(StubElement parent, int mask, @NotNull JetModifierListElementType<?> elementType) {
public KotlinModifierListStubImpl(StubElement parent, int mask, @NotNull JetModifierListElementType<?> elementType) {
super(parent, elementType);
this.mask = mask;
}
@@ -20,14 +20,15 @@ import com.intellij.psi.stubs.StubElement;
import com.intellij.util.io.StringRef;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetNameReferenceExpression;
import org.jetbrains.jet.lang.psi.stubs.PsiJetNameReferenceExpressionStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinNameReferenceExpressionStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
public class PsiJetNameReferenceExpressionStubImpl extends JetStubBaseImpl<JetNameReferenceExpression> implements PsiJetNameReferenceExpressionStub {
public class KotlinNameReferenceExpressionStubImpl extends KotlinStubBaseImpl<JetNameReferenceExpression> implements
KotlinNameReferenceExpressionStub {
@NotNull
private final StringRef referencedName;
public PsiJetNameReferenceExpressionStubImpl(StubElement parent, @NotNull StringRef referencedName) {
public KotlinNameReferenceExpressionStubImpl(StubElement parent, @NotNull StringRef referencedName) {
super(parent, JetStubElementTypes.REFERENCE_EXPRESSION);
this.referencedName = referencedName;
}
@@ -21,14 +21,14 @@ import com.intellij.util.io.StringRef;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.psi.JetObjectDeclaration;
import org.jetbrains.jet.lang.psi.stubs.PsiJetObjectStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinObjectStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import org.jetbrains.jet.lang.resolve.name.FqName;
import java.util.ArrayList;
import java.util.List;
public class PsiJetObjectStubImpl extends JetStubBaseImpl<JetObjectDeclaration> implements PsiJetObjectStub {
public class KotlinObjectStubImpl extends KotlinStubBaseImpl<JetObjectDeclaration> implements KotlinObjectStub {
private final StringRef name;
private final FqName fqName;
private final StringRef[] superNames;
@@ -37,7 +37,7 @@ public class PsiJetObjectStubImpl extends JetStubBaseImpl<JetObjectDeclaration>
private final boolean isLocal;
private final boolean isObjectLiteral;
public PsiJetObjectStubImpl(
public KotlinObjectStubImpl(
@NotNull StubElement parent,
@Nullable StringRef name,
@Nullable FqName fqName,
@@ -20,18 +20,18 @@ import com.intellij.psi.stubs.StubElement;
import com.intellij.util.io.StringRef;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.psi.JetParameter;
import org.jetbrains.jet.lang.psi.stubs.PsiJetParameterStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinParameterStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import org.jetbrains.jet.lang.resolve.name.FqName;
public class PsiJetParameterStubImpl extends JetStubBaseImpl<JetParameter> implements PsiJetParameterStub {
public class KotlinParameterStubImpl extends KotlinStubBaseImpl<JetParameter> implements KotlinParameterStub {
private final StringRef name;
private final boolean isMutable;
private final StringRef fqName;
private final boolean hasValOrValNode;
private final boolean hasDefaultValue;
public PsiJetParameterStubImpl(
public KotlinParameterStubImpl(
StubElement parent,
StringRef fqName, StringRef name,
boolean isMutable,
@@ -19,11 +19,11 @@ package org.jetbrains.jet.lang.psi.stubs.impl;
import com.intellij.psi.stubs.IStubElementType;
import com.intellij.psi.stubs.StubElement;
import org.jetbrains.jet.lang.psi.JetElementImplStub;
import org.jetbrains.jet.lang.psi.stubs.PsiJetPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinPlaceHolderStub;
public class PsiJetPlaceHolderStubImpl<T extends JetElementImplStub<? extends StubElement<?>>> extends JetStubBaseImpl<T>
implements PsiJetPlaceHolderStub<T> {
public PsiJetPlaceHolderStubImpl(StubElement parent, IStubElementType elementType) {
public class KotlinPlaceHolderStubImpl<T extends JetElementImplStub<? extends StubElement<?>>> extends KotlinStubBaseImpl<T>
implements KotlinPlaceHolderStub<T> {
public KotlinPlaceHolderStubImpl(StubElement parent, IStubElementType elementType) {
//noinspection unchecked
super(parent, elementType);
}
@@ -18,15 +18,15 @@ package org.jetbrains.jet.lang.psi.stubs.impl;
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.KotlinPropertyAccessorStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
public class PsiJetPropertyAccessorStubImpl extends JetStubBaseImpl<JetPropertyAccessor> implements PsiJetPropertyAccessorStub {
public class KotlinPropertyAccessorStubImpl extends KotlinStubBaseImpl<JetPropertyAccessor> implements KotlinPropertyAccessorStub {
private final boolean isGetter;
private final boolean hasBody;
private final boolean hasBlockBody;
public PsiJetPropertyAccessorStubImpl(StubElement parent, boolean isGetter, boolean hasBody, boolean hasBlockBody) {
public KotlinPropertyAccessorStubImpl(StubElement parent, boolean isGetter, boolean hasBody, boolean hasBlockBody) {
super(parent, JetStubElementTypes.PROPERTY_ACCESSOR);
this.isGetter = isGetter;
this.hasBody = hasBody;
@@ -20,11 +20,11 @@ import com.intellij.psi.stubs.StubElement;
import com.intellij.util.io.StringRef;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.psi.JetProperty;
import org.jetbrains.jet.lang.psi.stubs.PsiJetPropertyStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinPropertyStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import org.jetbrains.jet.lang.resolve.name.FqName;
public class PsiJetPropertyStubImpl extends JetStubBaseImpl<JetProperty> implements PsiJetPropertyStub {
public class KotlinPropertyStubImpl extends KotlinStubBaseImpl<JetProperty> implements KotlinPropertyStub {
private final StringRef name;
private final boolean isVar;
private final boolean isTopLevel;
@@ -35,7 +35,7 @@ public class PsiJetPropertyStubImpl extends JetStubBaseImpl<JetProperty> impleme
private final boolean hasReturnTypeRef;
private final FqName fqName;
public PsiJetPropertyStubImpl(
public KotlinPropertyStubImpl(
StubElement parent,
StringRef name,
boolean isVar,
@@ -22,12 +22,12 @@ 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 org.jetbrains.jet.lang.psi.stubs.KotlinClassOrObjectStub
import org.jetbrains.jet.lang.psi.stubs.KotlinStubWithFqName
import java.lang.reflect.Method
import java.util.ArrayList
public open class JetStubBaseImpl<T : JetElementImplStub<*>>(parent: StubElement<*>?, elementType: IStubElementType<*, *>) : StubBase<T>(parent, elementType) {
public open class KotlinStubBaseImpl<T : JetElementImplStub<*>>(parent: StubElement<*>?, elementType: IStubElementType<*, *>) : StubBase<T>(parent, elementType) {
override fun toString(): String {
val stubInterface = this.javaClass.getInterfaces().first()
@@ -74,8 +74,8 @@ public open class JetStubBaseImpl<T : JetElementImplStub<*>>(parent: StubElement
}
class object {
private val LOGGER: Logger = Logger.getInstance(javaClass<JetStubBaseImpl<JetElementImplStub<*>>>())
private val LOGGER: Logger = Logger.getInstance(javaClass<KotlinStubBaseImpl<JetElementImplStub<*>>>())
private val BASE_STUB_INTERFACES = listOf(javaClass<PsiJetStubWithFqName<*>>(), javaClass<PsiJetClassOrObjectStub<*>>(), javaClass<NamedStub<*>>())
private val BASE_STUB_INTERFACES = listOf(javaClass<KotlinStubWithFqName<*>>(), javaClass<KotlinClassOrObjectStub<*>>(), javaClass<NamedStub<*>>())
}
}
@@ -18,13 +18,13 @@ package org.jetbrains.jet.lang.psi.stubs.impl;
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.KotlinTypeConstraintStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
public class PsiJetTypeConstraintImpl extends JetStubBaseImpl<JetTypeConstraint> implements PsiJetTypeConstraintStub {
public class KotlinTypeConstraintImpl extends KotlinStubBaseImpl<JetTypeConstraint> implements KotlinTypeConstraintStub {
private final boolean isClassObjectConstraint;
public PsiJetTypeConstraintImpl(StubElement parent, boolean isClassObjectConstraint) {
public KotlinTypeConstraintImpl(StubElement parent, boolean isClassObjectConstraint) {
super(parent, JetStubElementTypes.TYPE_CONSTRAINT);
this.isClassObjectConstraint = isClassObjectConstraint;
}
@@ -20,16 +20,16 @@ import com.intellij.psi.stubs.StubElement;
import com.intellij.util.io.StringRef;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.psi.JetTypeParameter;
import org.jetbrains.jet.lang.psi.stubs.PsiJetTypeParameterStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinTypeParameterStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import org.jetbrains.jet.lang.resolve.name.FqName;
public class PsiJetTypeParameterStubImpl extends JetStubBaseImpl<JetTypeParameter> implements PsiJetTypeParameterStub {
public class KotlinTypeParameterStubImpl extends KotlinStubBaseImpl<JetTypeParameter> implements KotlinTypeParameterStub {
private final StringRef name;
private final boolean isInVariance;
private final boolean isOutVariance;
public PsiJetTypeParameterStubImpl(StubElement parent, StringRef name, boolean isInVariance, boolean isOutVariance) {
public KotlinTypeParameterStubImpl(StubElement parent, StringRef name, boolean isInVariance, boolean isOutVariance) {
super(parent, JetStubElementTypes.TYPE_PARAMETER);
this.name = name;
@@ -19,14 +19,14 @@ package org.jetbrains.jet.lang.psi.stubs.impl;
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.KotlinTypeProjectionStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
public class PsiJetTypeProjectionStubImpl extends JetStubBaseImpl<JetTypeProjection> implements PsiJetTypeProjectionStub {
public class KotlinTypeProjectionStubImpl extends KotlinStubBaseImpl<JetTypeProjection> implements KotlinTypeProjectionStub {
private final int projectionKindOrdinal;
public PsiJetTypeProjectionStubImpl(StubElement parent, int projectionKindOrdinal) {
public KotlinTypeProjectionStubImpl(StubElement parent, int projectionKindOrdinal) {
super(parent, JetStubElementTypes.TYPE_PROJECTION);
this.projectionKindOrdinal = projectionKindOrdinal;
}
@@ -18,13 +18,13 @@ package org.jetbrains.jet.lang.psi.stubs.impl;
import com.intellij.psi.stubs.StubElement;
import org.jetbrains.jet.lang.psi.JetUserType;
import org.jetbrains.jet.lang.psi.stubs.PsiJetUserTypeStub;
import org.jetbrains.jet.lang.psi.stubs.KotlinUserTypeStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
public class PsiJetUserTypeStubImpl extends JetStubBaseImpl<JetUserType> implements PsiJetUserTypeStub {
public class KotlinUserTypeStubImpl extends KotlinStubBaseImpl<JetUserType> implements KotlinUserTypeStub {
private final boolean isAbsoluteInRootPackage;
public PsiJetUserTypeStubImpl(StubElement parent, boolean isAbsoluteInRootPackage) {
public KotlinUserTypeStubImpl(StubElement parent, boolean isAbsoluteInRootPackage) {
super(parent, JetStubElementTypes.USER_TYPE);
this.isAbsoluteInRootPackage = isAbsoluteInRootPackage;
}
@@ -28,14 +28,14 @@ import org.jetbrains.jet.lang.resolve.name.Name;
public class StubIndexServiceImpl implements StubIndexService {
@Override
public void indexFile(PsiJetFileStub stub, IndexSink sink) {
public void indexFile(KotlinFileStub stub, IndexSink sink) {
FqName packageFqName = stub.getPackageFqName();
sink.occurrence(JetExactPackagesIndex.getInstance().getKey(), packageFqName.asString());
}
@Override
public void indexClass(PsiJetClassStub stub, IndexSink sink) {
public void indexClass(KotlinClassStub stub, IndexSink sink) {
String name = stub.getName();
if (name != null) {
sink.occurrence(JetClassShortNameIndex.getInstance().getKey(), name);
@@ -51,18 +51,18 @@ public class StubIndexServiceImpl implements StubIndexService {
}
@Override
public void indexObject(PsiJetObjectStub stub, IndexSink sink) {
public void indexObject(KotlinObjectStub stub, IndexSink sink) {
String name = stub.getName();
FqName fqName = stub.getFqName();
if (stub.isClassObject()) {
StubElement parentClassStub = stub.getParentStub().getParentStub().getParentStub();
assert parentClassStub instanceof PsiJetStubWithFqName<?>
assert parentClassStub instanceof KotlinStubWithFqName<?>
: "Something but a class/object is a parent to class object stub: " + parentClassStub;
name = JvmAbi.CLASS_OBJECT_CLASS_NAME;
FqName parentFqName = ((PsiJetStubWithFqName<?>) parentClassStub).getFqName();
FqName parentFqName = ((KotlinStubWithFqName<?>) parentClassStub).getFqName();
if (parentFqName != null) {
fqName = parentFqName.child(Name.identifier(name));
}
@@ -84,7 +84,7 @@ public class StubIndexServiceImpl implements StubIndexService {
recordClassOrObjectByPackage(stub, sink);
}
private static void indexSuperNames(PsiJetClassOrObjectStub<? extends JetClassOrObject> stub, IndexSink sink) {
private static void indexSuperNames(KotlinClassOrObjectStub<? extends JetClassOrObject> stub, IndexSink sink) {
for (String superName : stub.getSuperNames()) {
sink.occurrence(JetSuperClassIndex.getInstance().getKey(), superName);
}
@@ -92,15 +92,15 @@ public class StubIndexServiceImpl implements StubIndexService {
private static void recordClassOrObjectByPackage(StubElement<? extends JetClassOrObject> stub, IndexSink sink) {
StubElement parentStub = stub.getParentStub();
if (parentStub instanceof PsiJetFileStub) {
PsiJetFileStub jetFileStub = (PsiJetFileStub) parentStub;
if (parentStub instanceof KotlinFileStub) {
KotlinFileStub jetFileStub = (KotlinFileStub) parentStub;
FqName packageFqName = jetFileStub.getPackageFqName();
sink.occurrence(JetClassByPackageIndex.getInstance().getKey(), packageFqName.asString());
}
}
@Override
public void indexFunction(PsiJetFunctionStub stub, IndexSink sink) {
public void indexFunction(KotlinFunctionStub stub, IndexSink sink) {
String name = stub.getName();
if (name != null) {
if (stub.isTopLevel()) {
@@ -122,7 +122,7 @@ public class StubIndexServiceImpl implements StubIndexService {
}
@Override
public void indexProperty(PsiJetPropertyStub stub, IndexSink sink) {
public void indexProperty(KotlinPropertyStub stub, IndexSink sink) {
String name = stub.getName();
if (name != null) {
if (stub.isTopLevel()) {
@@ -147,7 +147,7 @@ public class StubIndexServiceImpl implements StubIndexService {
}
@Override
public void indexAnnotation(PsiJetAnnotationEntryStub stub, IndexSink sink) {
public void indexAnnotation(KotlinAnnotationEntryStub stub, IndexSink sink) {
sink.occurrence(JetAnnotationsIndex.getInstance().getKey(), stub.getShortName());
}
}
@@ -23,17 +23,17 @@ import com.intellij.psi.stubs.StubElement
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes
import org.junit.Assert
import org.jetbrains.jet.lang.psi.JetPackageDirective
import org.jetbrains.jet.lang.psi.stubs.PsiJetPlaceHolderStub
import org.jetbrains.jet.lang.psi.stubs.KotlinPlaceHolderStub
import org.jetbrains.jet.lang.psi.JetImportList
import org.jetbrains.jet.lang.psi.JetNamedFunction
import org.jetbrains.jet.lang.psi.stubs.PsiJetFunctionStub
import org.jetbrains.jet.lang.psi.stubs.KotlinFunctionStub
import org.jetbrains.jet.lang.psi.JetTypeReference
import org.jetbrains.jet.lang.psi.stubs.PsiJetClassStub
import org.jetbrains.jet.lang.psi.stubs.KotlinClassStub
import org.jetbrains.jet.lang.psi.JetClass
import org.jetbrains.jet.lang.psi.stubs.PsiJetObjectStub
import org.jetbrains.jet.lang.psi.stubs.KotlinObjectStub
import org.jetbrains.jet.lang.psi.JetObjectDeclaration
import org.jetbrains.jet.lang.psi.JetProperty
import org.jetbrains.jet.lang.psi.stubs.PsiJetPropertyStub
import org.jetbrains.jet.lang.psi.stubs.KotlinPropertyStub
import kotlin.test.assertEquals
import org.jetbrains.jet.lang.psi.JetClassBody
import org.jetbrains.jet.lang.psi.JetClassInitializer
@@ -52,14 +52,14 @@ public class DebugTextByStubTest : LightCodeInsightFixtureTestCase() {
fun packageDirective(text: String) {
val (file, tree) = createFileAndStubTree(text)
val packageDirective = tree.findChildStubByType(JetStubElementTypes.PACKAGE_DIRECTIVE)
val psi = JetPackageDirective(packageDirective as PsiJetPlaceHolderStub)
val psi = JetPackageDirective(packageDirective as KotlinPlaceHolderStub)
Assert.assertEquals(file.getPackageDirective()!!.getText(), psi.getDebugText())
}
fun function(text: String) {
val (file, tree) = createFileAndStubTree(text)
val function = tree.findChildStubByType(JetStubElementTypes.FUNCTION)
val psi = JetNamedFunction(function as PsiJetFunctionStub)
val psi = JetNamedFunction(function as KotlinFunctionStub)
Assert.assertEquals("STUB: " + file.findChildByClass(javaClass<JetNamedFunction>())!!.getText(), psi.getDebugText())
}
@@ -69,7 +69,7 @@ public class DebugTextByStubTest : LightCodeInsightFixtureTestCase() {
val parameterList = function.findChildStubByType(JetStubElementTypes.VALUE_PARAMETER_LIST)!!
val valueParameter = parameterList.findChildStubByType(JetStubElementTypes.VALUE_PARAMETER)!!
val typeReferenceStub = valueParameter.findChildStubByType(JetStubElementTypes.TYPE_REFERENCE)
val psiFromStub = JetTypeReference(typeReferenceStub as PsiJetPlaceHolderStub)
val psiFromStub = JetTypeReference(typeReferenceStub as KotlinPlaceHolderStub)
val typeReferenceByPsi = file.findChildByClass(javaClass<JetNamedFunction>())!!.getValueParameters()[0].getTypeReference()
Assert.assertEquals(typeReferenceByPsi!!.getText(), psiFromStub.getDebugText())
}
@@ -77,7 +77,7 @@ public class DebugTextByStubTest : LightCodeInsightFixtureTestCase() {
fun clazz(text: String, expectedText: String? = null) {
val (file, tree) = createFileAndStubTree(text)
val clazz = tree.findChildStubByType(JetStubElementTypes.CLASS)!!
val psiFromStub = JetClass(clazz as PsiJetClassStub)
val psiFromStub = JetClass(clazz as KotlinClassStub)
val classByPsi = file.findChildByClass(javaClass<JetClass>())
val toCheckAgainst = "STUB: " + (expectedText ?: classByPsi!!.getText())
Assert.assertEquals(toCheckAgainst, psiFromStub.getDebugText())
@@ -89,7 +89,7 @@ public class DebugTextByStubTest : LightCodeInsightFixtureTestCase() {
fun obj(text: String, expectedText: String? = null) {
val (file, tree) = createFileAndStubTree(text)
val obj = tree.findChildStubByType(JetStubElementTypes.OBJECT_DECLARATION)!!
val psiFromStub = JetObjectDeclaration(obj as PsiJetObjectStub)
val psiFromStub = JetObjectDeclaration(obj as KotlinObjectStub)
val objectByPsi = file.findChildByClass(javaClass<JetObjectDeclaration>())
val toCheckAgainst = "STUB: " + (expectedText ?: objectByPsi!!.getText())
Assert.assertEquals(toCheckAgainst, psiFromStub.getDebugText())
@@ -98,7 +98,7 @@ public class DebugTextByStubTest : LightCodeInsightFixtureTestCase() {
fun property(text: String, expectedText: String? = null) {
val (file, tree) = createFileAndStubTree(text)
val property = tree.findChildStubByType(JetStubElementTypes.PROPERTY)!!
val psiFromStub = JetProperty(property as PsiJetPropertyStub)
val psiFromStub = JetProperty(property as KotlinPropertyStub)
val propertyByPsi = file.findChildByClass(javaClass<JetProperty>())
val toCheckAgainst = "STUB: " + (expectedText ?: propertyByPsi!!.getText())
Assert.assertEquals(toCheckAgainst, psiFromStub.getDebugText())
@@ -107,7 +107,7 @@ public class DebugTextByStubTest : LightCodeInsightFixtureTestCase() {
fun importList(text: String) {
val (file, tree) = createFileAndStubTree(text)
val importList = tree.findChildStubByType(JetStubElementTypes.IMPORT_LIST)
val psi = JetImportList(importList as PsiJetPlaceHolderStub)
val psi = JetImportList(importList as KotlinPlaceHolderStub)
Assert.assertEquals(file.getImportList()!!.getText(), psi.getDebugText())
}
@@ -190,21 +190,21 @@ public class DebugTextByStubTest : LightCodeInsightFixtureTestCase() {
fun testClassBody() {
val tree = createStubTree("class A {\n {} fun f(): Int val c: Int}")
val classBody = tree.findChildStubByType(JetStubElementTypes.CLASS)!!.findChildStubByType(JetStubElementTypes.CLASS_BODY)
assertEquals("class body for STUB: class A", JetClassBody(classBody as PsiJetPlaceHolderStub).getDebugText())
assertEquals("class body for STUB: class A", JetClassBody(classBody as KotlinPlaceHolderStub).getDebugText())
}
fun testClassInitializer() {
val tree = createStubTree("class A {\n {} }")
val initializer = tree.findChildStubByType(JetStubElementTypes.CLASS)!!.findChildStubByType(JetStubElementTypes.CLASS_BODY)!!
.findChildStubByType(JetStubElementTypes.ANONYMOUS_INITIALIZER)
assertEquals("initializer in STUB: class A", JetClassInitializer(initializer as PsiJetPlaceHolderStub).getDebugText())
assertEquals("initializer in STUB: class A", JetClassInitializer(initializer as KotlinPlaceHolderStub).getDebugText())
}
fun testClassObject() {
val tree = createStubTree("class A { class object {} }")
val classObject = tree.findChildStubByType(JetStubElementTypes.CLASS)!!.findChildStubByType(JetStubElementTypes.CLASS_BODY)!!
.findChildStubByType(JetStubElementTypes.CLASS_OBJECT)
assertEquals("class object in STUB: class A", JetClassObject(classObject as PsiJetPlaceHolderStub).getDebugText())
assertEquals("class object in STUB: class A", JetClassObject(classObject as KotlinPlaceHolderStub).getDebugText())
}
fun testPropertyAccessors() {

Some files were not shown because too many files have changed in this diff Show More