Rename: AnnotationStub -> AnnotationEntryStub
This commit is contained in:
@@ -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.PsiJetAnnotationStub;
|
||||
import org.jetbrains.jet.lang.psi.stubs.PsiJetAnnotationEntryStub;
|
||||
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
|
||||
|
||||
import java.util.Collections;
|
||||
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) {
|
||||
super(node);
|
||||
}
|
||||
|
||||
public JetAnnotationEntry(@NotNull PsiJetAnnotationStub stub) {
|
||||
public JetAnnotationEntry(@NotNull PsiJetAnnotationEntryStub stub) {
|
||||
super(stub, JetStubElementTypes.ANNOTATION_ENTRY);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -19,6 +19,6 @@ package org.jetbrains.jet.lang.psi.stubs;
|
||||
import com.intellij.psi.stubs.StubElement;
|
||||
import org.jetbrains.jet.lang.psi.JetAnnotationEntry;
|
||||
|
||||
public interface PsiJetAnnotationStub extends StubElement<JetAnnotationEntry> {
|
||||
public interface PsiJetAnnotationEntryStub extends StubElement<JetAnnotationEntry> {
|
||||
String getShortName();
|
||||
}
|
||||
+11
-11
@@ -25,39 +25,39 @@ 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.PsiJetAnnotationStub;
|
||||
import org.jetbrains.jet.lang.psi.stubs.impl.PsiJetAnnotationStubImpl;
|
||||
import org.jetbrains.jet.lang.psi.stubs.PsiJetAnnotationEntryStub;
|
||||
import org.jetbrains.jet.lang.psi.stubs.impl.PsiJetAnnotationEntryStubImpl;
|
||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class JetAnnotationElementType extends JetStubElementType<PsiJetAnnotationStub, JetAnnotationEntry> {
|
||||
public class JetAnnotationEntryElementType extends JetStubElementType<PsiJetAnnotationEntryStub, JetAnnotationEntry> {
|
||||
|
||||
public JetAnnotationElementType(@NotNull @NonNls String debugName) {
|
||||
super(debugName, JetAnnotationEntry.class, PsiJetAnnotationStub.class);
|
||||
public JetAnnotationEntryElementType(@NotNull @NonNls String debugName) {
|
||||
super(debugName, JetAnnotationEntry.class, PsiJetAnnotationEntryStub.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PsiJetAnnotationStub createStub(@NotNull JetAnnotationEntry psi, StubElement parentStub) {
|
||||
public PsiJetAnnotationEntryStub createStub(@NotNull JetAnnotationEntry psi, StubElement parentStub) {
|
||||
Name shortName = JetPsiUtil.getShortName(psi);
|
||||
String resultName = shortName != null ? shortName.asString() : psi.getText();
|
||||
return new PsiJetAnnotationStubImpl(parentStub, resultName);
|
||||
return new PsiJetAnnotationEntryStubImpl(parentStub, resultName);
|
||||
}
|
||||
|
||||
@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());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@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();
|
||||
return new PsiJetAnnotationStubImpl(parentStub, text);
|
||||
return new PsiJetAnnotationEntryStubImpl(parentStub, text);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void indexStub(@NotNull PsiJetAnnotationStub stub, @NotNull IndexSink sink) {
|
||||
public void indexStub(@NotNull PsiJetAnnotationEntryStub stub, @NotNull IndexSink sink) {
|
||||
StubIndexServiceFactory.getInstance().indexAnnotation(stub, sink);
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -35,7 +35,7 @@ public interface JetStubElementTypes {
|
||||
JetPlaceHolderStubElementType<JetTypeParameterList> TYPE_PARAMETER_LIST =
|
||||
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 =
|
||||
new JetPlaceHolderStubElementType<JetClassBody>("CLASS_BODY", JetClassBody.class);
|
||||
@@ -56,6 +56,6 @@ public interface JetStubElementTypes {
|
||||
|
||||
JetPlaceHolderStubElementType<JetTypeReference> TYPE_REFERENCE =
|
||||
new JetPlaceHolderStubElementType<JetTypeReference>("TYPE_REFERENCE", JetTypeReference.class);;
|
||||
|
||||
|
||||
JetUserTypeElementType USER_TYPE = new JetUserTypeElementType("USER_TYPE");
|
||||
}
|
||||
|
||||
+2
-2
@@ -46,7 +46,7 @@ public interface StubIndexService {
|
||||
}
|
||||
|
||||
@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 indexObject(PsiJetObjectStub stub, IndexSink sink);
|
||||
void indexProperty(PsiJetPropertyStub stub, IndexSink sink);
|
||||
void indexAnnotation(PsiJetAnnotationStub stub, IndexSink sink);
|
||||
void indexAnnotation(PsiJetAnnotationEntryStub stub, IndexSink sink);
|
||||
}
|
||||
|
||||
+5
-5
@@ -21,17 +21,17 @@ 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.PsiJetAnnotationEntryStub;
|
||||
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;
|
||||
|
||||
public PsiJetAnnotationStubImpl(StubElement parent, @NotNull String shortName) {
|
||||
public PsiJetAnnotationEntryStubImpl(StubElement parent, @NotNull String shortName) {
|
||||
this(parent, StringRef.fromString(shortName));
|
||||
}
|
||||
|
||||
public PsiJetAnnotationStubImpl(StubElement parent, StringRef shortName) {
|
||||
public PsiJetAnnotationEntryStubImpl(StubElement parent, StringRef shortName) {
|
||||
super(parent, JetStubElementTypes.ANNOTATION_ENTRY);
|
||||
this.shortName = shortName;
|
||||
}
|
||||
@@ -44,7 +44,7 @@ public class PsiJetAnnotationStubImpl extends StubBase<JetAnnotationEntry> imple
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("PsiJetAnnotationStubImpl[");
|
||||
builder.append("PsiJetAnnotationEntryStubImpl[");
|
||||
builder.append("shortName=").append(getShortName());
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
@@ -143,7 +143,7 @@ public class StubIndexServiceImpl implements StubIndexService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void indexAnnotation(PsiJetAnnotationStub stub, IndexSink sink) {
|
||||
public void indexAnnotation(PsiJetAnnotationEntryStub stub, IndexSink sink) {
|
||||
sink.occurrence(JetAnnotationsIndex.getInstance().getKey(), stub.getShortName());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user