Refactor: fix stubs and psi having redundant constructor parameters
This commit is contained in:
@@ -18,7 +18,6 @@ package org.jetbrains.jet.lang.psi;
|
||||
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.stubs.IStubElementType;
|
||||
import com.intellij.psi.stubs.StubElement;
|
||||
import com.intellij.psi.tree.TokenSet;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
@@ -26,6 +25,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.JetNodeTypes;
|
||||
import org.jetbrains.jet.lang.psi.stubs.PsiJetClassBodyStub;
|
||||
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
|
||||
import org.jetbrains.jet.lexer.JetTokens;
|
||||
|
||||
import java.util.List;
|
||||
@@ -35,8 +35,8 @@ public class JetClassBody extends JetElementImplStub<PsiJetClassBodyStub> implem
|
||||
super(node);
|
||||
}
|
||||
|
||||
public JetClassBody(@NotNull PsiJetClassBodyStub stub, @NotNull IStubElementType nodeType) {
|
||||
super(stub, nodeType);
|
||||
public JetClassBody(@NotNull PsiJetClassBodyStub stub) {
|
||||
super(stub, JetStubElementTypes.CLASS_BODY);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,12 +19,12 @@ package org.jetbrains.jet.lang.psi;
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.navigation.ItemPresentation;
|
||||
import com.intellij.navigation.ItemPresentationProviders;
|
||||
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.JetNodeTypes;
|
||||
import org.jetbrains.jet.lang.psi.stubs.PsiJetParameterStub;
|
||||
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
|
||||
import org.jetbrains.jet.lexer.JetTokens;
|
||||
|
||||
public class JetParameter extends JetNamedDeclarationStub<PsiJetParameterStub> {
|
||||
@@ -41,8 +41,8 @@ public class JetParameter extends JetNamedDeclarationStub<PsiJetParameterStub> {
|
||||
super(node);
|
||||
}
|
||||
|
||||
public JetParameter(@NotNull PsiJetParameterStub stub, @NotNull IStubElementType nodeType) {
|
||||
super(stub, nodeType);
|
||||
public JetParameter(@NotNull PsiJetParameterStub stub) {
|
||||
super(stub, JetStubElementTypes.VALUE_PARAMETER);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package org.jetbrains.jet.lang.psi;
|
||||
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.psi.stubs.IStubElementType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.lang.psi.stubs.PsiJetParameterListStub;
|
||||
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
|
||||
@@ -30,8 +29,8 @@ public class JetParameterList extends JetElementImplStub<PsiJetParameterListStub
|
||||
super(node);
|
||||
}
|
||||
|
||||
public JetParameterList(@NotNull PsiJetParameterListStub stub, @NotNull IStubElementType nodeType) {
|
||||
super(stub, nodeType);
|
||||
public JetParameterList(@NotNull PsiJetParameterListStub stub) {
|
||||
super(stub, JetStubElementTypes.VALUE_PARAMETER_LIST);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -20,7 +20,6 @@ import com.intellij.lang.ASTNode;
|
||||
import com.intellij.navigation.ItemPresentation;
|
||||
import com.intellij.navigation.ItemPresentationProviders;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.stubs.IStubElementType;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import com.intellij.psi.tree.TokenSet;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
@@ -28,6 +27,7 @@ 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.elements.JetStubElementTypes;
|
||||
import org.jetbrains.jet.lexer.JetTokens;
|
||||
|
||||
import java.util.List;
|
||||
@@ -42,8 +42,8 @@ public class JetProperty extends JetTypeParameterListOwnerStub<PsiJetPropertyStu
|
||||
super(node);
|
||||
}
|
||||
|
||||
public JetProperty(@NotNull PsiJetPropertyStub stub, @NotNull IStubElementType nodeType) {
|
||||
super(stub, nodeType);
|
||||
public JetProperty(@NotNull PsiJetPropertyStub stub) {
|
||||
super(stub, JetStubElementTypes.PROPERTY);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
package org.jetbrains.jet.lang.psi;
|
||||
|
||||
import com.intellij.lang.ASTNode;
|
||||
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.JetNodeTypes;
|
||||
import org.jetbrains.jet.lang.psi.stubs.PsiJetTypeParameterStub;
|
||||
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
|
||||
import org.jetbrains.jet.lang.types.Variance;
|
||||
import org.jetbrains.jet.lexer.JetTokens;
|
||||
|
||||
@@ -40,8 +40,8 @@ public class JetTypeParameter extends JetNamedDeclarationStub<PsiJetTypeParamete
|
||||
super(node);
|
||||
}
|
||||
|
||||
public JetTypeParameter(@NotNull PsiJetTypeParameterStub stub, @NotNull IStubElementType nodeType) {
|
||||
super(stub, nodeType);
|
||||
public JetTypeParameter(@NotNull PsiJetTypeParameterStub stub) {
|
||||
super(stub, JetStubElementTypes.TYPE_PARAMETER);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package org.jetbrains.jet.lang.psi;
|
||||
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.psi.stubs.IStubElementType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.lang.psi.stubs.PsiJetTypeParameterListStub;
|
||||
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
|
||||
@@ -30,8 +29,8 @@ public class JetTypeParameterList extends JetElementImplStub<PsiJetTypeParameter
|
||||
super(node);
|
||||
}
|
||||
|
||||
public JetTypeParameterList(@NotNull PsiJetTypeParameterListStub stub, @NotNull IStubElementType nodeType) {
|
||||
super(stub, nodeType);
|
||||
public JetTypeParameterList(@NotNull PsiJetTypeParameterListStub stub) {
|
||||
super(stub, JetStubElementTypes.TYPE_PARAMETER_LIST);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
+4
-3
@@ -24,7 +24,8 @@ import com.intellij.psi.stubs.StubOutputStream;
|
||||
import com.intellij.util.io.StringRef;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.lang.psi.*;
|
||||
import org.jetbrains.jet.lang.psi.JetAnnotationEntry;
|
||||
import org.jetbrains.jet.lang.psi.JetPsiUtil;
|
||||
import org.jetbrains.jet.lang.psi.stubs.PsiJetAnnotationStub;
|
||||
import org.jetbrains.jet.lang.psi.stubs.impl.PsiJetAnnotationStubImpl;
|
||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
@@ -51,7 +52,7 @@ public class JetAnnotationElementType extends JetStubElementType<PsiJetAnnotatio
|
||||
public PsiJetAnnotationStub createStub(@NotNull JetAnnotationEntry psi, StubElement parentStub) {
|
||||
Name shortName = JetPsiUtil.getShortName(psi);
|
||||
String resultName = shortName != null ? shortName.asString() : psi.getText();
|
||||
return new PsiJetAnnotationStubImpl(parentStub, JetStubElementTypes.ANNOTATION_ENTRY, resultName);
|
||||
return new PsiJetAnnotationStubImpl(parentStub, resultName);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -63,7 +64,7 @@ public class JetAnnotationElementType extends JetStubElementType<PsiJetAnnotatio
|
||||
@Override
|
||||
public PsiJetAnnotationStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
|
||||
StringRef text = dataStream.readName();
|
||||
return new PsiJetAnnotationStubImpl(parentStub, JetStubElementTypes.ANNOTATION_ENTRY, text);
|
||||
return new PsiJetAnnotationStubImpl(parentStub, text);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+3
-3
@@ -41,12 +41,12 @@ public class JetClassBodyElementType extends JetStubElementType<PsiJetClassBodyS
|
||||
|
||||
@Override
|
||||
public JetClassBody createPsi(@NotNull PsiJetClassBodyStub stub) {
|
||||
return new JetClassBody(stub, JetStubElementTypes.CLASS_BODY);
|
||||
return new JetClassBody(stub);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PsiJetClassBodyStub createStub(@NotNull JetClassBody psi, StubElement parentStub) {
|
||||
return new PsiJetClassBodyStubImpl(parentStub, JetStubElementTypes.CLASS_BODY);
|
||||
return new PsiJetClassBodyStubImpl(parentStub);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -57,7 +57,7 @@ public class JetClassBodyElementType extends JetStubElementType<PsiJetClassBodyS
|
||||
@NotNull
|
||||
@Override
|
||||
public PsiJetClassBodyStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
|
||||
return new PsiJetClassBodyStubImpl(parentStub, JetStubElementTypes.CLASS_BODY);
|
||||
return new PsiJetClassBodyStubImpl(parentStub);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-2
@@ -69,7 +69,7 @@ public class JetFunctionElementType extends JetStubElementType<PsiJetFunctionStu
|
||||
|
||||
FqName qualifiedName = psi.getFqName();
|
||||
|
||||
return new PsiJetFunctionStubImpl(JetStubElementTypes.FUNCTION, parentStub, psi.getName(), isTopLevel, qualifiedName, isExtension);
|
||||
return new PsiJetFunctionStubImpl(parentStub, psi.getName(), isTopLevel, qualifiedName, isExtension);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -94,7 +94,7 @@ public class JetFunctionElementType extends JetStubElementType<PsiJetFunctionStu
|
||||
|
||||
boolean isExtension = dataStream.readBoolean();
|
||||
|
||||
return new PsiJetFunctionStubImpl(JetStubElementTypes.FUNCTION, parentStub, name, isTopLevel, fqName, isExtension);
|
||||
return new PsiJetFunctionStubImpl(parentStub, name, isTopLevel, fqName, isExtension);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-4
@@ -61,7 +61,6 @@ public class JetObjectElementType extends JetStubElementType<PsiJetObjectStub, J
|
||||
FqName fqName = psi.getFqName();
|
||||
List<String> superNames = PsiUtilPackage.getSuperNames(psi);
|
||||
return new PsiJetObjectStubImpl(
|
||||
JetStubElementTypes.OBJECT_DECLARATION,
|
||||
parentStub,
|
||||
name,
|
||||
fqName,
|
||||
@@ -107,9 +106,7 @@ public class JetObjectElementType extends JetStubElementType<PsiJetObjectStub, J
|
||||
superNames[i] = dataStream.readName();
|
||||
}
|
||||
|
||||
return new PsiJetObjectStubImpl(
|
||||
JetStubElementTypes.OBJECT_DECLARATION, parentStub, name, fqName, superNames, isTopLevel, isClassObject, isLocal
|
||||
);
|
||||
return new PsiJetObjectStubImpl(parentStub, name, fqName, superNames, isTopLevel, isClassObject, isLocal);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+3
-3
@@ -46,7 +46,7 @@ public class JetParameterElementType extends JetStubElementType<PsiJetParameterS
|
||||
|
||||
@Override
|
||||
public JetParameter createPsi(@NotNull PsiJetParameterStub stub) {
|
||||
return new JetParameter(stub, JetStubElementTypes.VALUE_PARAMETER);
|
||||
return new JetParameter(stub);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -54,7 +54,7 @@ public class JetParameterElementType extends JetStubElementType<PsiJetParameterS
|
||||
JetTypeReference typeReference = psi.getTypeReference();
|
||||
JetExpression defaultValue = psi.getDefaultValue();
|
||||
|
||||
return new PsiJetParameterStubImpl(JetStubElementTypes.VALUE_PARAMETER, parentStub, psi.getFqName(),
|
||||
return new PsiJetParameterStubImpl(parentStub, psi.getFqName(),
|
||||
psi.getName(), psi.isMutable(), psi.isVarArg(),
|
||||
typeReference != null ? typeReference.getText() : null,
|
||||
defaultValue != null ? defaultValue.getText() : null);
|
||||
@@ -91,7 +91,7 @@ public class JetParameterElementType extends JetStubElementType<PsiJetParameterS
|
||||
StringRef fqNameAsString = dataStream.readName();
|
||||
FqName fqName = fqNameAsString != null ? new FqName(fqNameAsString.toString()) : null;
|
||||
|
||||
return new PsiJetParameterStubImpl(JetStubElementTypes.VALUE_PARAMETER, parentStub, fqName, name, isMutable, isVarArg,
|
||||
return new PsiJetParameterStubImpl(parentStub, fqName, name, isMutable, isVarArg,
|
||||
typeText, defaultValueText);
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -41,12 +41,12 @@ public class JetParameterListElementType extends JetStubElementType<PsiJetParame
|
||||
|
||||
@Override
|
||||
public JetParameterList createPsi(@NotNull PsiJetParameterListStub stub) {
|
||||
return new JetParameterList(stub, JetStubElementTypes.VALUE_PARAMETER_LIST);
|
||||
return new JetParameterList(stub);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PsiJetParameterListStub createStub(@NotNull JetParameterList psi, StubElement parentStub) {
|
||||
return new PsiJetParameterListStubImpl(JetStubElementTypes.VALUE_PARAMETER_LIST, parentStub);
|
||||
return new PsiJetParameterListStubImpl(parentStub);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -57,7 +57,7 @@ public class JetParameterListElementType extends JetStubElementType<PsiJetParame
|
||||
@NotNull
|
||||
@Override
|
||||
public PsiJetParameterListStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
|
||||
return new PsiJetParameterListStubImpl(JetStubElementTypes.VALUE_PARAMETER_LIST, parentStub);
|
||||
return new PsiJetParameterListStubImpl(parentStub);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+3
-3
@@ -46,7 +46,7 @@ public class JetPropertyElementType extends JetStubElementType<PsiJetPropertyStu
|
||||
|
||||
@Override
|
||||
public JetProperty createPsi(@NotNull PsiJetPropertyStub stub) {
|
||||
return new JetProperty(stub, JetStubElementTypes.PROPERTY);
|
||||
return new JetProperty(stub);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -71,7 +71,7 @@ public class JetPropertyElementType extends JetStubElementType<PsiJetPropertyStu
|
||||
String.format("Should not store local property: %s, parent %s",
|
||||
psi.getText(), psi.getParent() != null ? psi.getParent().getText() : "<no parent>");
|
||||
|
||||
return new PsiJetPropertyStubImpl(JetStubElementTypes.PROPERTY, parentStub,
|
||||
return new PsiJetPropertyStubImpl(parentStub,
|
||||
psi.getName(), psi.isVar(), psi.isTopLevel(), psi.getFqName(),
|
||||
typeRef != null ? typeRef.getText() : null,
|
||||
expression != null ? expression.getText() : null);
|
||||
@@ -103,7 +103,7 @@ public class JetPropertyElementType extends JetStubElementType<PsiJetPropertyStu
|
||||
StringRef typeText = dataStream.readName();
|
||||
StringRef inferenceBodyText = dataStream.readName();
|
||||
|
||||
return new PsiJetPropertyStubImpl(JetStubElementTypes.PROPERTY, parentStub,
|
||||
return new PsiJetPropertyStubImpl(parentStub,
|
||||
name, isVar, isTopLevel, fqName, typeText, inferenceBodyText);
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -44,13 +44,13 @@ public class JetTypeParameterElementType extends JetStubElementType<PsiJetTypePa
|
||||
|
||||
@Override
|
||||
public JetTypeParameter createPsi(@NotNull PsiJetTypeParameterStub stub) {
|
||||
return new JetTypeParameter(stub, JetStubElementTypes.TYPE_PARAMETER);
|
||||
return new JetTypeParameter(stub);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PsiJetTypeParameterStub createStub(@NotNull JetTypeParameter psi, StubElement parentStub) {
|
||||
JetTypeReference extendsBound = psi.getExtendsBound();
|
||||
return new PsiJetTypeParameterStubImpl(JetStubElementTypes.TYPE_PARAMETER, parentStub,
|
||||
return new PsiJetTypeParameterStubImpl(parentStub,
|
||||
psi.getName(),
|
||||
extendsBound != null ? extendsBound.getText() : null,
|
||||
psi.getVariance() == Variance.IN_VARIANCE,
|
||||
@@ -73,7 +73,7 @@ public class JetTypeParameterElementType extends JetStubElementType<PsiJetTypePa
|
||||
boolean isInVariance = dataStream.readBoolean();
|
||||
boolean isOutVariance = dataStream.readBoolean();
|
||||
|
||||
return new PsiJetTypeParameterStubImpl(JetStubElementTypes.TYPE_PARAMETER, parentStub,
|
||||
return new PsiJetTypeParameterStubImpl(parentStub,
|
||||
name, extendBoundTypeText, isInVariance, isOutVariance);
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -41,12 +41,12 @@ public class JetTypeParameterListElementType extends JetStubElementType<PsiJetTy
|
||||
|
||||
@Override
|
||||
public JetTypeParameterList createPsi(@NotNull PsiJetTypeParameterListStub stub) {
|
||||
return new JetTypeParameterList(stub, JetStubElementTypes.TYPE_PARAMETER_LIST);
|
||||
return new JetTypeParameterList(stub);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PsiJetTypeParameterListStub createStub(@NotNull JetTypeParameterList psi, StubElement parentStub) {
|
||||
return new PsiJetTypeParameterListStubImpl(JetStubElementTypes.TYPE_PARAMETER_LIST, parentStub);
|
||||
return new PsiJetTypeParameterListStubImpl(parentStub);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -56,8 +56,8 @@ public class JetTypeParameterListElementType extends JetStubElementType<PsiJetTy
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public PsiJetTypeParameterListStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
|
||||
return new PsiJetTypeParameterListStubImpl(JetStubElementTypes.TYPE_PARAMETER_LIST, parentStub);
|
||||
public PsiJetTypeParameterListStub deserialize(StubInputStream dataStream, StubElement parentStub) throws IOException {
|
||||
return new PsiJetTypeParameterListStubImpl(parentStub);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+5
-5
@@ -16,23 +16,23 @@
|
||||
|
||||
package org.jetbrains.jet.lang.psi.stubs.impl;
|
||||
|
||||
import com.intellij.psi.stubs.IStubElementType;
|
||||
import com.intellij.psi.stubs.StubBase;
|
||||
import com.intellij.psi.stubs.StubElement;
|
||||
import com.intellij.util.io.StringRef;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.lang.psi.JetAnnotationEntry;
|
||||
import org.jetbrains.jet.lang.psi.stubs.PsiJetAnnotationStub;
|
||||
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
|
||||
|
||||
public class PsiJetAnnotationStubImpl extends StubBase<JetAnnotationEntry> implements PsiJetAnnotationStub {
|
||||
private final StringRef shortName;
|
||||
|
||||
public PsiJetAnnotationStubImpl(StubElement parent, IStubElementType elementType, @NotNull String shortName) {
|
||||
this(parent, elementType, StringRef.fromString(shortName));
|
||||
public PsiJetAnnotationStubImpl(StubElement parent, @NotNull String shortName) {
|
||||
this(parent, StringRef.fromString(shortName));
|
||||
}
|
||||
|
||||
public PsiJetAnnotationStubImpl(StubElement parent, IStubElementType elementType, StringRef shortName) {
|
||||
super(parent, elementType);
|
||||
public PsiJetAnnotationStubImpl(StubElement parent, StringRef shortName) {
|
||||
super(parent, JetStubElementTypes.ANNOTATION_ENTRY);
|
||||
this.shortName = shortName;
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -16,14 +16,14 @@
|
||||
|
||||
package org.jetbrains.jet.lang.psi.stubs.impl;
|
||||
|
||||
import com.intellij.psi.stubs.IStubElementType;
|
||||
import com.intellij.psi.stubs.StubBase;
|
||||
import com.intellij.psi.stubs.StubElement;
|
||||
import org.jetbrains.jet.lang.psi.JetClassBody;
|
||||
import org.jetbrains.jet.lang.psi.stubs.PsiJetClassBodyStub;
|
||||
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
|
||||
|
||||
public class PsiJetClassBodyStubImpl extends StubBase<JetClassBody> implements PsiJetClassBodyStub {
|
||||
public PsiJetClassBodyStubImpl(StubElement parent, IStubElementType elementType) {
|
||||
super(parent, elementType);
|
||||
public PsiJetClassBodyStubImpl(StubElement parent) {
|
||||
super(parent, JetStubElementTypes.CLASS_BODY);
|
||||
}
|
||||
}
|
||||
|
||||
+7
-7
@@ -16,7 +16,6 @@
|
||||
|
||||
package org.jetbrains.jet.lang.psi.stubs.impl;
|
||||
|
||||
import com.intellij.psi.stubs.IStubElementType;
|
||||
import com.intellij.psi.stubs.StubBase;
|
||||
import com.intellij.psi.stubs.StubElement;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
@@ -25,6 +24,7 @@ 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.elements.JetStubElementTypes;
|
||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||
|
||||
public class PsiJetFunctionStubImpl extends StubBase<JetNamedFunction> implements PsiJetFunctionStub {
|
||||
@@ -35,23 +35,23 @@ public class PsiJetFunctionStubImpl extends StubBase<JetNamedFunction> implement
|
||||
private final FqName fqName;
|
||||
|
||||
public PsiJetFunctionStubImpl(
|
||||
@NotNull IStubElementType elementType,
|
||||
@NotNull StubElement parent,
|
||||
@Nullable String name,
|
||||
boolean isTopLevel,
|
||||
@Nullable FqName fqName,
|
||||
boolean isExtension) {
|
||||
this(elementType, parent, StringRef.fromString(name), isTopLevel, fqName, isExtension);
|
||||
boolean isExtension
|
||||
) {
|
||||
this(parent, StringRef.fromString(name), isTopLevel, fqName, isExtension);
|
||||
}
|
||||
|
||||
public PsiJetFunctionStubImpl(
|
||||
@NotNull IStubElementType elementType,
|
||||
@NotNull StubElement parent,
|
||||
@Nullable StringRef nameRef,
|
||||
boolean isTopLevel,
|
||||
@Nullable FqName fqName,
|
||||
boolean isExtension) {
|
||||
super(parent, elementType);
|
||||
boolean isExtension
|
||||
) {
|
||||
super(parent, JetStubElementTypes.FUNCTION);
|
||||
|
||||
if (isTopLevel && fqName == null) {
|
||||
throw new IllegalArgumentException("fqName shouldn't be null for top level functions");
|
||||
|
||||
+7
-9
@@ -17,7 +17,6 @@
|
||||
package org.jetbrains.jet.lang.psi.stubs.impl;
|
||||
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.stubs.IStubElementType;
|
||||
import com.intellij.psi.stubs.StubBase;
|
||||
import com.intellij.psi.stubs.StubElement;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
@@ -26,6 +25,7 @@ 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.elements.JetStubElementTypes;
|
||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -40,8 +40,7 @@ public class PsiJetObjectStubImpl extends StubBase<JetObjectDeclaration> impleme
|
||||
private final boolean isLocal;
|
||||
|
||||
public PsiJetObjectStubImpl(
|
||||
@NotNull IStubElementType elementType,
|
||||
StubElement parent,
|
||||
@NotNull StubElement parent,
|
||||
@Nullable String name,
|
||||
@Nullable FqName fqName,
|
||||
@NotNull List<String> superNames,
|
||||
@@ -49,20 +48,19 @@ public class PsiJetObjectStubImpl extends StubBase<JetObjectDeclaration> impleme
|
||||
boolean isClassObject,
|
||||
boolean isLocal
|
||||
) {
|
||||
this(elementType, parent, StringRef.fromString(name), fqName, Utils.instance$.wrapStrings(superNames), isTopLevel, isClassObject, isLocal);
|
||||
this(parent, StringRef.fromString(name), fqName, Utils.instance$.wrapStrings(superNames), isTopLevel, isClassObject, isLocal);
|
||||
}
|
||||
|
||||
public PsiJetObjectStubImpl(
|
||||
@NotNull IStubElementType elementType,
|
||||
StubElement parent,
|
||||
@NotNull StubElement parent,
|
||||
@Nullable StringRef name,
|
||||
@Nullable FqName fqName,
|
||||
@NotNull StringRef[] superNames,
|
||||
boolean isTopLevel,
|
||||
boolean isClassObject,
|
||||
boolean isLocal) {
|
||||
super(parent, elementType);
|
||||
|
||||
boolean isLocal
|
||||
) {
|
||||
super(parent, JetStubElementTypes.OBJECT_DECLARATION);
|
||||
this.name = name;
|
||||
this.fqName = fqName;
|
||||
this.superNames = superNames;
|
||||
|
||||
+3
-3
@@ -16,15 +16,15 @@
|
||||
|
||||
package org.jetbrains.jet.lang.psi.stubs.impl;
|
||||
|
||||
import com.intellij.psi.stubs.IStubElementType;
|
||||
import com.intellij.psi.stubs.StubBase;
|
||||
import com.intellij.psi.stubs.StubElement;
|
||||
import org.jetbrains.jet.lang.psi.JetParameterList;
|
||||
import org.jetbrains.jet.lang.psi.stubs.PsiJetParameterListStub;
|
||||
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
|
||||
|
||||
public class PsiJetParameterListStubImpl extends StubBase<JetParameterList> implements PsiJetParameterListStub {
|
||||
public PsiJetParameterListStubImpl(IStubElementType elementType, StubElement parent) {
|
||||
super(parent, elementType);
|
||||
public PsiJetParameterListStubImpl(StubElement parent) {
|
||||
super(parent, JetStubElementTypes.VALUE_PARAMETER_LIST);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+5
-5
@@ -16,13 +16,13 @@
|
||||
|
||||
package org.jetbrains.jet.lang.psi.stubs.impl;
|
||||
|
||||
import com.intellij.psi.stubs.IStubElementType;
|
||||
import com.intellij.psi.stubs.StubBase;
|
||||
import com.intellij.psi.stubs.StubElement;
|
||||
import 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.elements.JetStubElementTypes;
|
||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||
|
||||
public class PsiJetParameterStubImpl extends StubBase<JetParameter> implements PsiJetParameterStub {
|
||||
@@ -34,13 +34,13 @@ public class PsiJetParameterStubImpl extends StubBase<JetParameter> implements P
|
||||
private final FqName fqName;
|
||||
|
||||
public PsiJetParameterStubImpl(
|
||||
IStubElementType elementType, StubElement parent,
|
||||
StubElement parent,
|
||||
FqName fqName, StringRef name,
|
||||
boolean isMutable,
|
||||
boolean isVarArg,
|
||||
StringRef typeText, StringRef defaultValueText
|
||||
) {
|
||||
super(parent, elementType);
|
||||
super(parent, JetStubElementTypes.VALUE_PARAMETER);
|
||||
this.name = name;
|
||||
this.isMutable = isMutable;
|
||||
this.isVarArg = isVarArg;
|
||||
@@ -50,14 +50,14 @@ public class PsiJetParameterStubImpl extends StubBase<JetParameter> implements P
|
||||
}
|
||||
|
||||
public PsiJetParameterStubImpl(
|
||||
IStubElementType elementType, StubElement parent,
|
||||
StubElement parent,
|
||||
FqName fqName, String name,
|
||||
boolean isMutable,
|
||||
boolean isVarArg,
|
||||
String typeText,
|
||||
String defaultValueText
|
||||
) {
|
||||
this(elementType, parent, fqName, StringRef.fromString(name), isMutable, isVarArg,
|
||||
this(parent, fqName, StringRef.fromString(name), isMutable, isVarArg,
|
||||
StringRef.fromString(typeText), StringRef.fromString(defaultValueText));
|
||||
}
|
||||
|
||||
|
||||
+8
-6
@@ -16,13 +16,13 @@
|
||||
|
||||
package org.jetbrains.jet.lang.psi.stubs.impl;
|
||||
|
||||
import com.intellij.psi.stubs.IStubElementType;
|
||||
import com.intellij.psi.stubs.StubBase;
|
||||
import com.intellij.psi.stubs.StubElement;
|
||||
import 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.elements.JetStubElementTypes;
|
||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||
|
||||
public class PsiJetPropertyStubImpl extends StubBase<JetProperty> implements PsiJetPropertyStub {
|
||||
@@ -33,9 +33,11 @@ public class PsiJetPropertyStubImpl extends StubBase<JetProperty> implements Psi
|
||||
private final StringRef typeText;
|
||||
private final StringRef inferenceBodyText;
|
||||
|
||||
public PsiJetPropertyStubImpl(IStubElementType elementType, StubElement parent, StringRef name,
|
||||
boolean isVar, boolean isTopLevel, @Nullable FqName fqName, StringRef typeText, StringRef inferenceBodyText) {
|
||||
super(parent, elementType);
|
||||
public PsiJetPropertyStubImpl(
|
||||
StubElement parent, StringRef name,
|
||||
boolean isVar, boolean isTopLevel, @Nullable FqName fqName, StringRef typeText, StringRef inferenceBodyText
|
||||
) {
|
||||
super(parent, JetStubElementTypes.PROPERTY);
|
||||
|
||||
if (isTopLevel && fqName == null) {
|
||||
throw new IllegalArgumentException("fqName shouldn't be null for top level properties");
|
||||
@@ -49,11 +51,11 @@ public class PsiJetPropertyStubImpl extends StubBase<JetProperty> implements Psi
|
||||
this.inferenceBodyText = inferenceBodyText;
|
||||
}
|
||||
|
||||
public PsiJetPropertyStubImpl(IStubElementType elementType, StubElement parent, String name,
|
||||
public PsiJetPropertyStubImpl(StubElement parent, String name,
|
||||
boolean isVar, boolean isTopLevel, @Nullable FqName topFQName,
|
||||
String typeText, String inferenceBodyText
|
||||
) {
|
||||
this(elementType, parent, StringRef.fromString(name),
|
||||
this(parent, StringRef.fromString(name),
|
||||
isVar, isTopLevel, topFQName, StringRef.fromString(typeText), StringRef.fromString(inferenceBodyText));
|
||||
}
|
||||
|
||||
|
||||
+3
-4
@@ -16,16 +16,15 @@
|
||||
|
||||
package org.jetbrains.jet.lang.psi.stubs.impl;
|
||||
|
||||
import com.intellij.psi.stubs.IStubElementType;
|
||||
import com.intellij.psi.stubs.StubBase;
|
||||
import com.intellij.psi.stubs.StubElement;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.lang.psi.JetTypeParameterList;
|
||||
import org.jetbrains.jet.lang.psi.stubs.PsiJetTypeParameterListStub;
|
||||
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
|
||||
|
||||
public class PsiJetTypeParameterListStubImpl extends StubBase<JetTypeParameterList> implements PsiJetTypeParameterListStub {
|
||||
public PsiJetTypeParameterListStubImpl(@NotNull IStubElementType elementType, StubElement parent) {
|
||||
super(parent, elementType);
|
||||
public PsiJetTypeParameterListStubImpl(StubElement parent) {
|
||||
super(parent, JetStubElementTypes.TYPE_PARAMETER_LIST);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+9
-7
@@ -22,7 +22,7 @@ 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.elements.JetTypeParameterElementType;
|
||||
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
|
||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||
|
||||
public class PsiJetTypeParameterStubImpl extends StubBase<JetTypeParameter> implements PsiJetTypeParameterStub {
|
||||
@@ -31,9 +31,10 @@ public class PsiJetTypeParameterStubImpl extends StubBase<JetTypeParameter> impl
|
||||
private final boolean isInVariance;
|
||||
private final boolean isOutVariance;
|
||||
|
||||
public PsiJetTypeParameterStubImpl(JetTypeParameterElementType type, StubElement parent,
|
||||
StringRef name, StringRef extendBoundTypeText, boolean isInVariance, boolean isOutVariance) {
|
||||
super(parent, type);
|
||||
public PsiJetTypeParameterStubImpl(
|
||||
StubElement parent, StringRef name, StringRef extendBoundTypeText, boolean isInVariance, boolean isOutVariance
|
||||
) {
|
||||
super(parent, JetStubElementTypes.TYPE_PARAMETER);
|
||||
|
||||
this.name = name;
|
||||
this.extendBoundTypeText = extendBoundTypeText;
|
||||
@@ -41,9 +42,10 @@ public class PsiJetTypeParameterStubImpl extends StubBase<JetTypeParameter> impl
|
||||
this.isOutVariance = isOutVariance;
|
||||
}
|
||||
|
||||
public PsiJetTypeParameterStubImpl(JetTypeParameterElementType type, StubElement parent,
|
||||
String name, String extendBoundTypeText, boolean isInVariance, boolean isOutVariance) {
|
||||
this(type, parent, StringRef.fromString(name), StringRef.fromString(extendBoundTypeText), isInVariance, isOutVariance);
|
||||
public PsiJetTypeParameterStubImpl(
|
||||
StubElement parent, String name, String extendBoundTypeText, boolean isInVariance, boolean isOutVariance
|
||||
) {
|
||||
this(parent, StringRef.fromString(name), StringRef.fromString(extendBoundTypeText), isInVariance, isOutVariance);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user