@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"); } } } } }
@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()); } } }
@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()); } }
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); } }
@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); } }
@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); } }
@Override public void indexStub(LuaCompoundIdentifierStub stub, IndexSink sink) { String name = stub.getName(); if (StringUtil.isNotEmpty(name) && stub.isGlobalDeclaration()) { sink.occurrence(LuaGlobalDeclarationIndex.KEY, name); } }
@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); } }
@Override public void indexStub(@NotNull PsiAnnotationStub stub, @NotNull IndexSink sink) { String shortName = getReferenceShortName(stub.getText()); if (!StringUtil.isEmptyOrSpaces(shortName)) { sink.occurrence(JavaStubIndexKeys.ANNOTATIONS, shortName); } }
@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()); } } }
@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); } }
@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()); } }
@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); } }
@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); } } }
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); } } }
@Override public void indexStub(@NotNull GrReferenceListStub stub, @NotNull IndexSink sink) { for (String name : stub.getBaseClasses()) { if (name != null) { sink.occurrence(GrDirectInheritorsIndex.KEY, PsiNameHelper.getShortClassName(name)); } } }
@Override public void indexStub(@NotNull ShaderDefStub stub, @NotNull IndexSink sink) { String name = stub.getName(); if(name != null) { sink.occurrence(ShaderDefIndex.KEY, name); } }
@Override public void indexStub(@NotNull S stub, @NotNull IndexSink sink) { final String name = stub.getName(); if (name != null) { sink.occurrence(HaskellAllNameIndex.KEY, name); } }
@Override public void indexStub(@NotNull final PsiMethodStub stub, @NotNull final IndexSink sink) { final String name = stub.getName(); if (name != null) { sink.occurrence(JavaStubIndexKeys.METHODS, name); if (RecordUtil.isStaticNonPrivateMember(stub)) { sink.occurrence(JavaStubIndexKeys.JVM_STATIC_MEMBERS_NAMES, name); sink.occurrence(JavaStubIndexKeys.JVM_STATIC_MEMBERS_TYPES, stub.getReturnTypeText(false).getShortTypeText()); } } }
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); } } }
public void indexStub(@NotNull GrReferenceListStub stub, @NotNull IndexSink sink) { for (String name : stub.getBaseClasses()) { if (name != null) { sink.occurrence(GrDirectInheritorsIndex.KEY, PsiNameHelper.getShortClassName(name)); } } }
@Override public void indexClass(@NotNull MsilClassEntryStub stub, @NotNull IndexSink indexSink) { String name = stub.getName(); if(StringUtil.isEmpty(name)) { return; } if(stub.isNested()) { return; } List<StubElement> childrenStubs = stub.getChildrenStubs(); for(StubElement childrenStub : childrenStubs) { if(childrenStub instanceof MsilCustomAttributeStub && Comparing.equal(((MsilCustomAttributeStub) childrenStub).getTypeRef(), DotNetTypes.System.Runtime.CompilerServices .ExtensionAttribute)) { indexSink.occurrence(CSharpIndexKeys.TYPE_WITH_EXTENSION_METHODS_INDEX, DotNetNamespaceStubUtil.getIndexableNamespace(stub.getNamespace())); break; } } indexSink.occurrence(CSharpIndexKeys.TYPE_BY_QNAME_INDEX, MsilHelper.appendNoGeneric(stub.getNamespace(), stub.getName())); }
@Override public void indexMethod(@NotNull MsilMethodEntryStub stub, @NotNull IndexSink indexSink) { List<StubElement> childrenStubs = stub.getChildrenStubs(); for(StubElement childrenStub : childrenStubs) { if(childrenStub instanceof MsilCustomAttributeStub && Comparing.equal(((MsilCustomAttributeStub) childrenStub).getTypeRef(), DotNetTypes.System.Runtime.CompilerServices .ExtensionAttribute)) { indexSink.occurrence(CSharpIndexKeys.EXTENSION_METHOD_BY_NAME_INDEX, stub.getNameFromBytecode()); break; } } }
@Override @RequiredReadAction public void indexStub(@NotNull CSharpMethodDeclStub stub, @NotNull IndexSink indexSink) { String name = getName(stub); if(!StringUtil.isEmpty(name)) { indexSink.occurrence(CSharpIndexKeys.METHOD_INDEX, name); if(!stub.isNested()) { if(BitUtil.isSet(stub.getOtherModifierMask(), CSharpMethodDeclStub.DELEGATE_MASK)) { String parentQName = stub.getParentQName(); DotNetNamespaceStubUtil.indexStub(indexSink, CSharpIndexKeys.MEMBER_BY_NAMESPACE_QNAME_INDEX, CSharpIndexKeys.MEMBER_BY_ALL_NAMESPACE_QNAME_INDEX, parentQName, name); } } if(BitUtil.isSet(stub.getOtherModifierMask(), CSharpMethodDeclStub.EXTENSION_MASK)) { indexSink.occurrence(CSharpIndexKeys.EXTENSION_METHOD_BY_NAME_INDEX, name); } if(BitUtil.isSet(stub.getOtherModifierMask(), CSharpMethodDeclStub.DELEGATE_MASK)) { indexSink.occurrence(CSharpIndexKeys.DELEGATE_METHOD_BY_NAME_INDEX, name); } } }
@Override @RequiredReadAction public void indexStub(@NotNull CSharpVariableDeclStub<DotNetFieldDeclaration> stub, @NotNull IndexSink indexSink) { String name = getName(stub); if(!StringUtil.isEmpty(name)) { indexSink.occurrence(CSharpIndexKeys.FIELD_INDEX, name); } }
@Override @RequiredReadAction public void indexStub(@NotNull CSharpVariableDeclStub<CSharpPropertyDeclarationImpl> stub, @NotNull IndexSink indexSink) { String name = getName(stub); if(!StringUtil.isEmpty(name)) { indexSink.occurrence(CSharpIndexKeys.PROPERTY_INDEX, name); } }
@Override public void indexStub(@NotNull CSharpVariableDeclStub<DotNetEventDeclaration> stub, @NotNull IndexSink indexSink) { String name = getName(stub); if(!StringUtil.isEmpty(name)) { indexSink.occurrence(CSharpIndexKeys.EVENT_INDEX, name); } }
@Override @RequiredReadAction public void indexStub(@NotNull CSharpVariableDeclStub<CSharpEnumConstantDeclarationImpl> stub, @NotNull IndexSink indexSink) { String name = getName(stub); if(!StringUtil.isEmpty(name)) { indexSink.occurrence(CSharpIndexKeys.FIELD_INDEX, name); } }
@Override public void indexStub(@NotNull CSharpTypeListStub cSharpTypeListStub, @NotNull IndexSink indexSink) { if(cSharpTypeListStub.getStubType() == CSharpStubElements.EXTENDS_LIST) { for(String ref : cSharpTypeListStub.geShortReferences()) { indexSink.occurrence(CSharpIndexKeys.EXTENDS_LIST_INDEX, ref); } } }
@Override public void indexStub(LuaCompoundIdentifierStub stub, IndexSink sink) { // String name = stub.getName(); // // if (StringUtil.isNotEmpty(name) && stub.isGlobalDeclaration()) { // sink.occurrence(LuaGlobalDeclarationIndex.KEY, name); // } }
@Override public void indexStub(LuaGlobalDeclarationStub stub, IndexSink sink) { 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); assert name != null; sink.occurrence(LuaGlobalDeclarationIndex.KEY, name); } }
@Override public void indexStub(LuaFieldStub stub, IndexSink sink) { // String name = stub.getName(); // // if (name != null) { // sink.occurrence(LuaFieldIndex.KEY, name); // } }
@Override public void indexStub(@NotNull MsilMethodEntryStub msilMethodEntryStub, @NotNull IndexSink indexSink) { for(MsilStubIndexer indexer : MsilStubIndexer.EP_NAME.getExtensions()) { indexer.indexMethod(msilMethodEntryStub, indexSink); } }
@Override public void indexStub(@NotNull MsilTypeListStub msilTypeListStub, @NotNull IndexSink indexSink) { if(this == MsilStubElements.EXTENDS_TYPE_LIST || this == MsilStubElements.IMPLEMENTS_TYPE_LIST) { for(String ref : msilTypeListStub.geShortReferences()) { indexSink.occurrence(MsilIndexKeys.EXTENDS_LIST_INDEX, ref); } } }