本文整理汇总了Java中com.intellij.psi.stubs.IndexSink类的典型用法代码示例。如果您正苦于以下问题:Java IndexSink类的具体用法?Java IndexSink怎么用?Java IndexSink使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IndexSink类属于com.intellij.psi.stubs包,在下文中一共展示了IndexSink类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: indexStub
import com.intellij.psi.stubs.IndexSink; //导入依赖的package包/类
@Override
public void indexStub(@NotNull PsiClassReferenceListStub stub, @NotNull IndexSink sink) {
PsiReferenceList.Role role = stub.getRole();
if (role == PsiReferenceList.Role.EXTENDS_LIST || role == PsiReferenceList.Role.IMPLEMENTS_LIST) {
String[] names = stub.getReferencedNames();
for (String name : names) {
String shortName = PsiNameHelper.getShortClassName(name);
if (!StringUtil.isEmptyOrSpaces(shortName)) {
sink.occurrence(JavaStubIndexKeys.SUPER_CLASSES, shortName);
}
}
if (role == PsiReferenceList.Role.EXTENDS_LIST) {
StubElement parentStub = stub.getParentStub();
if (parentStub instanceof PsiClassStub) {
PsiClassStub psiClassStub = (PsiClassStub)parentStub;
if (psiClassStub.isEnum()) {
sink.occurrence(JavaStubIndexKeys.SUPER_CLASSES, "Enum");
}
if (psiClassStub.isAnnotationType()) {
sink.occurrence(JavaStubIndexKeys.SUPER_CLASSES, "Annotation");
}
}
}
}
}
示例2: indexStub
import com.intellij.psi.stubs.IndexSink; //导入依赖的package包/类
@Override
public void indexStub(@NotNull final PsiClassStub stub, @NotNull final IndexSink sink) {
boolean isAnonymous = stub.isAnonymous();
if (isAnonymous) {
String baseRef = stub.getBaseClassReferenceText();
if (baseRef != null) {
sink.occurrence(JavaStubIndexKeys.ANONYMOUS_BASEREF, PsiNameHelper.getShortClassName(baseRef));
}
}
else {
final String shortName = stub.getName();
if (shortName != null) {
sink.occurrence(JavaStubIndexKeys.CLASS_SHORT_NAMES, shortName);
}
final String fqn = stub.getQualifiedName();
if (fqn != null) {
sink.occurrence(JavaStubIndexKeys.CLASS_FQN, fqn.hashCode());
}
}
}
示例3: indexStub
import com.intellij.psi.stubs.IndexSink; //导入依赖的package包/类
@Override
@RequiredReadAction
public void indexStub(@NotNull CSharpTypeDeclStub stub, @NotNull IndexSink indexSink)
{
String name = getName(stub);
if(!StringUtil.isEmpty(name))
{
indexSink.occurrence(CSharpIndexKeys.TYPE_INDEX, name);
String parentQName = stub.getParentQName();
if(!stub.isNested())
{
DotNetNamespaceStubUtil.indexStub(indexSink, CSharpIndexKeys.MEMBER_BY_NAMESPACE_QNAME_INDEX, CSharpIndexKeys.MEMBER_BY_ALL_NAMESPACE_QNAME_INDEX, parentQName, name);
if(BitUtil.isSet(stub.getOtherModifierMask(), CSharpTypeDeclStub.HAVE_EXTENSIONS))
{
indexSink.occurrence(CSharpIndexKeys.TYPE_WITH_EXTENSION_METHODS_INDEX, DotNetNamespaceStubUtil.getIndexableNamespace(parentQName));
}
}
indexSink.occurrence(CSharpIndexKeys.TYPE_BY_QNAME_INDEX, getNameWithNamespaceForIndexing(parentQName, name));
indexSink.occurrence(CSharpIndexKeys.TYPE_BY_VMQNAME_INDEX, stub.getVmQName());
}
}
示例4: indexStub
import com.intellij.psi.stubs.IndexSink; //导入依赖的package包/类
public static void indexStub(@NotNull IndexSink indexSink,
@NotNull StubIndexKey<String, ? extends DotNetQualifiedElement> elementByQNameKey,
@NotNull StubIndexKey<String, ? extends DotNetQualifiedElement> namespaceKey,
@NotNull String namespace,
@NotNull String name)
{
String indexableNamespace = getIndexableNamespace(namespace);
name = consulo.internal.dotnet.msil.decompiler.util.MsilHelper.cutGenericMarker(name);
indexSink.occurrence(elementByQNameKey, indexableNamespace + "." + name);
if(!StringUtil.isEmpty(namespace))
{
QualifiedName parent = QualifiedName.fromDottedString(namespace);
do
{
indexSink.occurrence(namespaceKey, getIndexableNamespace(parent));
}
while((parent = parent.getParent()) != null);
}
else
{
indexSink.occurrence(namespaceKey, indexableNamespace);
}
}
示例5: indexStub
import com.intellij.psi.stubs.IndexSink; //导入依赖的package包/类
@Override
public void indexStub(@NotNull MsilClassEntryStub msilClassEntryStub, @NotNull IndexSink indexSink)
{
indexSink.occurrence(MsilIndexKeys.TYPE_BY_NAME_INDEX, MsilHelper.cutGenericMarker(msilClassEntryStub.getName()));
indexSink.occurrence(MsilIndexKeys.TYPE_BY_QNAME_INDEX, msilClassEntryStub.getVmQName());
if(!msilClassEntryStub.isNested())
{
DotNetNamespaceStubUtil.indexStub(indexSink, MsilIndexKeys.ELEMENT_BY_QNAME_INDEX, MsilIndexKeys.NAMESPACE_INDEX, msilClassEntryStub.getNamespace(), msilClassEntryStub.getName());
}
for(MsilStubIndexer indexer : MsilStubIndexer.EP_NAME.getExtensions())
{
indexer.indexClass(msilClassEntryStub, indexSink);
}
}
示例6: indexStub
import com.intellij.psi.stubs.IndexSink; //导入依赖的package包/类
@Override
public void indexStub(@NotNull StubT stub, @NotNull IndexSink sink)
{
final String name = stub.getName();
final String fqn = stub.getQualifiedName();
if(name != null && doIndexName(stub, name, fqn))
{
sink.occurrence(JavaScriptIndexKeys.ELEMENTS_BY_NAME, name);
}
if(fqn != null && doIndexQualifiedName(stub, name, fqn))
{
sink.occurrence(JavaScriptIndexKeys.ELEMENTS_BY_QNAME, fqn);
}
}
示例7: indexStub
import com.intellij.psi.stubs.IndexSink; //导入依赖的package包/类
@Override
public void indexStub(LuaCompoundIdentifierStub stub, IndexSink sink) {
String name = stub.getName();
if (StringUtil.isNotEmpty(name) && stub.isGlobalDeclaration()) {
sink.occurrence(LuaGlobalDeclarationIndex.KEY, name);
}
}
示例8: indexStub
import com.intellij.psi.stubs.IndexSink; //导入依赖的package包/类
@Override
public void indexStub(LuaModuleDeclarationStub stub, IndexSink sink) {
final String module = stub.getModule();
final String stubName = stub.getName();
if (StringUtil.isNotEmpty(stubName)) {
String name = StringUtil.isEmpty(module) ? stubName : module + '.' + stubName;
log.debug("sink: " + name);
sink.occurrence(LuaGlobalDeclarationIndex.KEY, name);
}
}
示例9: indexStub
import com.intellij.psi.stubs.IndexSink; //导入依赖的package包/类
@Override
public void indexStub(@NotNull PsiAnnotationStub stub, @NotNull IndexSink sink) {
String shortName = getReferenceShortName(stub.getText());
if (!StringUtil.isEmptyOrSpaces(shortName)) {
sink.occurrence(JavaStubIndexKeys.ANNOTATIONS, shortName);
}
}
示例10: indexStub
import com.intellij.psi.stubs.IndexSink; //导入依赖的package包/类
@Override
public void indexStub(@NotNull final PsiFieldStub stub, @NotNull final IndexSink sink) {
final String name = stub.getName();
if (name != null) {
sink.occurrence(JavaStubIndexKeys.FIELDS, name);
if (RecordUtil.isStaticNonPrivateMember(stub)) {
sink.occurrence(JavaStubIndexKeys.JVM_STATIC_MEMBERS_NAMES, name);
sink.occurrence(JavaStubIndexKeys.JVM_STATIC_MEMBERS_TYPES, stub.getType(false).getShortTypeText());
}
}
}
示例11: indexStub
import com.intellij.psi.stubs.IndexSink; //导入依赖的package包/类
@Override
public void indexStub(@NotNull PyTargetExpressionStub stub, @NotNull IndexSink sink) {
String name = stub.getName();
if (name != null && PyUtil.getInitialUnderscores(name) == 0) {
if (stub.getParentStub() instanceof PyFileStub) {
sink.occurrence(PyVariableNameIndex.KEY, name);
}
else if (isInstanceAttributeStub(stub)) {
sink.occurrence(PyInstanceAttributeIndex.KEY, name);
}
}
for (CustomTargetExpressionStubType stubType : getCustomStubTypes()) {
stubType.indexStub(stub, sink);
}
}
示例12: indexStub
import com.intellij.psi.stubs.IndexSink; //导入依赖的package包/类
@Override
public void indexStub(@NotNull final PyDecoratorStub stub, @NotNull final IndexSink sink) {
// Index decorators stub by name (todo: index by FQDN as well!)
final QualifiedName qualifiedName = stub.getQualifiedName();
if (qualifiedName != null) {
sink.occurrence(PyDecoratorStubIndex.KEY, qualifiedName.toString());
}
}
示例13: indexStub
import com.intellij.psi.stubs.IndexSink; //导入依赖的package包/类
@Override
public void indexStub(@NotNull ElementStub stub, @NotNull IndexSink sink) {
final String namespaceKey = stub.getNamespaceKey();
if (StringUtil.isNotEmpty(namespaceKey)) {
sink.occurrence(DomNamespaceKeyIndex.KEY, namespaceKey);
}
final String elementClass = stub.getElementClass();
if (elementClass != null) {
sink.occurrence(DomElementClassIndex.KEY, elementClass);
}
}
示例14: indexStub
import com.intellij.psi.stubs.IndexSink; //导入依赖的package包/类
@Override
public void indexStub(@NotNull GrMethodStub stub, @NotNull IndexSink sink) {
String name = stub.getName();
sink.occurrence(GrMethodNameIndex.KEY, name);
if (GrStubUtils.isGroovyStaticMemberStub(stub)) {
sink.occurrence(JavaStubIndexKeys.JVM_STATIC_MEMBERS_NAMES, name);
sink.occurrence(JavaStubIndexKeys.JVM_STATIC_MEMBERS_TYPES, GrStubUtils.getShortTypeText(stub.getTypeText()));
}
for (String annName : stub.getAnnotations()) {
if (annName != null) {
sink.occurrence(GrAnnotatedMemberIndex.KEY, annName);
}
}
}
示例15: indexFieldStub
import com.intellij.psi.stubs.IndexSink; //导入依赖的package包/类
static void indexFieldStub(GrFieldStub stub, IndexSink sink) {
String name = stub.getName();
sink.occurrence(GrFieldNameIndex.KEY, name);
if (GrStubUtils.isGroovyStaticMemberStub(stub)) {
sink.occurrence(JavaStubIndexKeys.JVM_STATIC_MEMBERS_NAMES, name);
sink.occurrence(JavaStubIndexKeys.JVM_STATIC_MEMBERS_TYPES, GrStubUtils.getShortTypeText(stub.getTypeText()));
}
for (String annName : stub.getAnnotations()) {
if (annName != null) {
sink.occurrence(GrAnnotatedMemberIndex.KEY, annName);
}
}
}