Rename: AnnotationStub -> AnnotationEntryStub

This commit is contained in:
Pavel V. Talanov
2014-03-26 17:24:20 +04:00
parent a604efebd9
commit 7e59f0d68c
7 changed files with 25 additions and 25 deletions
@@ -20,18 +20,18 @@ import com.intellij.lang.ASTNode;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.JetNodeTypes; import org.jetbrains.jet.JetNodeTypes;
import org.jetbrains.jet.lang.psi.stubs.PsiJetAnnotationStub; import org.jetbrains.jet.lang.psi.stubs.PsiJetAnnotationEntryStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes; import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
public class JetAnnotationEntry extends JetElementImplStub<PsiJetAnnotationStub> implements JetCallElement { public class JetAnnotationEntry extends JetElementImplStub<PsiJetAnnotationEntryStub> implements JetCallElement {
public JetAnnotationEntry(@NotNull ASTNode node) { public JetAnnotationEntry(@NotNull ASTNode node) {
super(node); super(node);
} }
public JetAnnotationEntry(@NotNull PsiJetAnnotationStub stub) { public JetAnnotationEntry(@NotNull PsiJetAnnotationEntryStub stub) {
super(stub, JetStubElementTypes.ANNOTATION_ENTRY); super(stub, JetStubElementTypes.ANNOTATION_ENTRY);
} }
@@ -19,6 +19,6 @@ package org.jetbrains.jet.lang.psi.stubs;
import com.intellij.psi.stubs.StubElement; import com.intellij.psi.stubs.StubElement;
import org.jetbrains.jet.lang.psi.JetAnnotationEntry; import org.jetbrains.jet.lang.psi.JetAnnotationEntry;
public interface PsiJetAnnotationStub extends StubElement<JetAnnotationEntry> { public interface PsiJetAnnotationEntryStub extends StubElement<JetAnnotationEntry> {
String getShortName(); String getShortName();
} }
@@ -25,39 +25,39 @@ import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetAnnotationEntry; import org.jetbrains.jet.lang.psi.JetAnnotationEntry;
import org.jetbrains.jet.lang.psi.JetPsiUtil; import org.jetbrains.jet.lang.psi.JetPsiUtil;
import org.jetbrains.jet.lang.psi.stubs.PsiJetAnnotationStub; import org.jetbrains.jet.lang.psi.stubs.PsiJetAnnotationEntryStub;
import org.jetbrains.jet.lang.psi.stubs.impl.PsiJetAnnotationStubImpl; import org.jetbrains.jet.lang.psi.stubs.impl.PsiJetAnnotationEntryStubImpl;
import org.jetbrains.jet.lang.resolve.name.Name; import org.jetbrains.jet.lang.resolve.name.Name;
import java.io.IOException; import java.io.IOException;
public class JetAnnotationElementType extends JetStubElementType<PsiJetAnnotationStub, JetAnnotationEntry> { public class JetAnnotationEntryElementType extends JetStubElementType<PsiJetAnnotationEntryStub, JetAnnotationEntry> {
public JetAnnotationElementType(@NotNull @NonNls String debugName) { public JetAnnotationEntryElementType(@NotNull @NonNls String debugName) {
super(debugName, JetAnnotationEntry.class, PsiJetAnnotationStub.class); super(debugName, JetAnnotationEntry.class, PsiJetAnnotationEntryStub.class);
} }
@Override @Override
public PsiJetAnnotationStub createStub(@NotNull JetAnnotationEntry psi, StubElement parentStub) { public PsiJetAnnotationEntryStub createStub(@NotNull JetAnnotationEntry psi, StubElement parentStub) {
Name shortName = JetPsiUtil.getShortName(psi); Name shortName = JetPsiUtil.getShortName(psi);
String resultName = shortName != null ? shortName.asString() : psi.getText(); String resultName = shortName != null ? shortName.asString() : psi.getText();
return new PsiJetAnnotationStubImpl(parentStub, resultName); return new PsiJetAnnotationEntryStubImpl(parentStub, resultName);
} }
@Override @Override
public void serialize(@NotNull PsiJetAnnotationStub stub, @NotNull StubOutputStream dataStream) throws IOException { public void serialize(@NotNull PsiJetAnnotationEntryStub stub, @NotNull StubOutputStream dataStream) throws IOException {
dataStream.writeName(stub.getShortName()); dataStream.writeName(stub.getShortName());
} }
@NotNull @NotNull
@Override @Override
public PsiJetAnnotationStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException { public PsiJetAnnotationEntryStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
StringRef text = dataStream.readName(); StringRef text = dataStream.readName();
return new PsiJetAnnotationStubImpl(parentStub, text); return new PsiJetAnnotationEntryStubImpl(parentStub, text);
} }
@Override @Override
public void indexStub(@NotNull PsiJetAnnotationStub stub, @NotNull IndexSink sink) { public void indexStub(@NotNull PsiJetAnnotationEntryStub stub, @NotNull IndexSink sink) {
StubIndexServiceFactory.getInstance().indexAnnotation(stub, sink); StubIndexServiceFactory.getInstance().indexAnnotation(stub, sink);
} }
} }
@@ -35,7 +35,7 @@ public interface JetStubElementTypes {
JetPlaceHolderStubElementType<JetTypeParameterList> TYPE_PARAMETER_LIST = JetPlaceHolderStubElementType<JetTypeParameterList> TYPE_PARAMETER_LIST =
new JetPlaceHolderStubElementType<JetTypeParameterList>("TYPE_PARAMETER_LIST", JetTypeParameterList.class); new JetPlaceHolderStubElementType<JetTypeParameterList>("TYPE_PARAMETER_LIST", JetTypeParameterList.class);
JetAnnotationElementType ANNOTATION_ENTRY = new JetAnnotationElementType("ANNOTATION_ENTRY"); JetAnnotationEntryElementType ANNOTATION_ENTRY = new JetAnnotationEntryElementType("ANNOTATION_ENTRY");
JetPlaceHolderStubElementType<JetClassBody> CLASS_BODY = JetPlaceHolderStubElementType<JetClassBody> CLASS_BODY =
new JetPlaceHolderStubElementType<JetClassBody>("CLASS_BODY", JetClassBody.class); new JetPlaceHolderStubElementType<JetClassBody>("CLASS_BODY", JetClassBody.class);
@@ -46,7 +46,7 @@ public interface StubIndexService {
} }
@Override @Override
public void indexAnnotation(PsiJetAnnotationStub stub, IndexSink sink) { public void indexAnnotation(PsiJetAnnotationEntryStub stub, IndexSink sink) {
} }
}; };
@@ -55,5 +55,5 @@ public interface StubIndexService {
void indexFunction(PsiJetFunctionStub stub, IndexSink sink); void indexFunction(PsiJetFunctionStub stub, IndexSink sink);
void indexObject(PsiJetObjectStub stub, IndexSink sink); void indexObject(PsiJetObjectStub stub, IndexSink sink);
void indexProperty(PsiJetPropertyStub stub, IndexSink sink); void indexProperty(PsiJetPropertyStub stub, IndexSink sink);
void indexAnnotation(PsiJetAnnotationStub stub, IndexSink sink); void indexAnnotation(PsiJetAnnotationEntryStub stub, IndexSink sink);
} }
@@ -21,17 +21,17 @@ import com.intellij.psi.stubs.StubElement;
import com.intellij.util.io.StringRef; import com.intellij.util.io.StringRef;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetAnnotationEntry; import org.jetbrains.jet.lang.psi.JetAnnotationEntry;
import org.jetbrains.jet.lang.psi.stubs.PsiJetAnnotationStub; import org.jetbrains.jet.lang.psi.stubs.PsiJetAnnotationEntryStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes; import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
public class PsiJetAnnotationStubImpl extends StubBase<JetAnnotationEntry> implements PsiJetAnnotationStub { public class PsiJetAnnotationEntryStubImpl extends StubBase<JetAnnotationEntry> implements PsiJetAnnotationEntryStub {
private final StringRef shortName; private final StringRef shortName;
public PsiJetAnnotationStubImpl(StubElement parent, @NotNull String shortName) { public PsiJetAnnotationEntryStubImpl(StubElement parent, @NotNull String shortName) {
this(parent, StringRef.fromString(shortName)); this(parent, StringRef.fromString(shortName));
} }
public PsiJetAnnotationStubImpl(StubElement parent, StringRef shortName) { public PsiJetAnnotationEntryStubImpl(StubElement parent, StringRef shortName) {
super(parent, JetStubElementTypes.ANNOTATION_ENTRY); super(parent, JetStubElementTypes.ANNOTATION_ENTRY);
this.shortName = shortName; this.shortName = shortName;
} }
@@ -44,7 +44,7 @@ public class PsiJetAnnotationStubImpl extends StubBase<JetAnnotationEntry> imple
@Override @Override
public String toString() { public String toString() {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.append("PsiJetAnnotationStubImpl["); builder.append("PsiJetAnnotationEntryStubImpl[");
builder.append("shortName=").append(getShortName()); builder.append("shortName=").append(getShortName());
builder.append("]"); builder.append("]");
return builder.toString(); return builder.toString();
@@ -143,7 +143,7 @@ public class StubIndexServiceImpl implements StubIndexService {
} }
@Override @Override
public void indexAnnotation(PsiJetAnnotationStub stub, IndexSink sink) { public void indexAnnotation(PsiJetAnnotationEntryStub stub, IndexSink sink) {
sink.occurrence(JetAnnotationsIndex.getInstance().getKey(), stub.getShortName()); sink.occurrence(JetAnnotationsIndex.getInstance().getKey(), stub.getShortName());
} }
} }