Refactor: remove redundant getElementType overrides is PSI
This commit is contained in:
@@ -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.annotations.Nullable;
|
||||
import org.jetbrains.jet.JetNodeTypes;
|
||||
@@ -32,12 +31,6 @@ public class JetAnnotationEntry extends JetElementImplStub<PsiJetAnnotationStub>
|
||||
super(node);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public IStubElementType getElementType() {
|
||||
return JetStubElementTypes.ANNOTATION_ENTRY;
|
||||
}
|
||||
|
||||
public JetAnnotationEntry(@NotNull PsiJetAnnotationStub stub) {
|
||||
super(stub, JetStubElementTypes.ANNOTATION_ENTRY);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ import com.intellij.navigation.ItemPresentationProviders;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.stubs.IStubElementType;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -165,12 +164,6 @@ public class JetClass extends JetTypeParameterListOwnerStub<PsiJetClassStub> imp
|
||||
return hasModifier(JetTokens.INNER_KEYWORD);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public IStubElementType getElementType() {
|
||||
return JetStubElementTypes.CLASS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete() throws IncorrectOperationException {
|
||||
JetPsiUtil.deleteClass(this);
|
||||
|
||||
@@ -18,13 +18,11 @@ 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.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.JetNodeTypes;
|
||||
import org.jetbrains.jet.lang.psi.stubs.PsiJetClassStub;
|
||||
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -55,12 +53,6 @@ public class JetEnumEntry extends JetClass {
|
||||
return nameAsDeclaration == null ? null : nameAsDeclaration.getNameIdentifier();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public IStubElementType getElementType() {
|
||||
return JetStubElementTypes.ENUM_ENTRY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PsiElement setName(@NonNls @NotNull String name) throws IncorrectOperationException {
|
||||
JetObjectDeclarationName nameAsDeclaration = getNameAsDeclaration();
|
||||
|
||||
@@ -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.util.PsiTreeUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -106,12 +105,6 @@ public class JetNamedFunction extends JetTypeParameterListOwnerStub<PsiJetFuncti
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public IStubElementType getElementType() {
|
||||
return JetStubElementTypes.FUNCTION;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemPresentation getPresentation() {
|
||||
return ItemPresentationProviders.getItemPresentation(this);
|
||||
|
||||
@@ -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.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -44,12 +43,6 @@ public class JetObjectDeclaration extends JetNamedDeclarationStub<PsiJetObjectSt
|
||||
super(stub, JetStubElementTypes.OBJECT_DECLARATION);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public IStubElementType getElementType() {
|
||||
return JetStubElementTypes.OBJECT_DECLARATION;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
PsiJetObjectStub stub = getStub();
|
||||
|
||||
@@ -25,7 +25,6 @@ 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> {
|
||||
@@ -46,12 +45,6 @@ public class JetParameter extends JetNamedDeclarationStub<PsiJetParameterStub> {
|
||||
super(stub, nodeType);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public IStubElementType getElementType() {
|
||||
return JetStubElementTypes.VALUE_PARAMETER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, D> R accept(@NotNull JetVisitor<R, D> visitor, D data) {
|
||||
return visitor.visitParameter(this, data);
|
||||
|
||||
@@ -34,12 +34,6 @@ public class JetParameterList extends JetElementImplStub<PsiJetParameterListStub
|
||||
super(stub, nodeType);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public IStubElementType getElementType() {
|
||||
return JetStubElementTypes.VALUE_PARAMETER_LIST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, D> R accept(@NotNull JetVisitor<R, D> visitor, D data) {
|
||||
return visitor.visitParameterList(this, data);
|
||||
|
||||
@@ -28,7 +28,6 @@ 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;
|
||||
@@ -52,12 +51,6 @@ public class JetProperty extends JetTypeParameterListOwnerStub<PsiJetPropertyStu
|
||||
return visitor.visitProperty(this, data);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public IStubElementType getElementType() {
|
||||
return JetStubElementTypes.PROPERTY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVar() {
|
||||
PsiJetPropertyStub stub = getStub();
|
||||
|
||||
@@ -23,7 +23,6 @@ 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;
|
||||
|
||||
@@ -71,10 +70,4 @@ public class JetTypeParameter extends JetNamedDeclarationStub<PsiJetTypeParamete
|
||||
public JetTypeReference getExtendsBound() {
|
||||
return (JetTypeReference) findChildByType(JetNodeTypes.TYPE_REFERENCE);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public IStubElementType getElementType() {
|
||||
return JetStubElementTypes.TYPE_PARAMETER;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,12 +39,6 @@ public class JetTypeParameterList extends JetElementImplStub<PsiJetTypeParameter
|
||||
return Arrays.asList(getStubOrPsiChildren(JetStubElementTypes.TYPE_PARAMETER, JetTypeParameter.ARRAY_FACTORY));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public IStubElementType getElementType() {
|
||||
return JetStubElementTypes.TYPE_PARAMETER_LIST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, D> R accept(@NotNull JetVisitor<R, D> visitor, D data) {
|
||||
return visitor.visitTypeParameterList(this, data);
|
||||
|
||||
Reference in New Issue
Block a user