Java 类com.intellij.psi.stubs.IndexSink 实例源码

项目:intellij-ce-playground    文件:JavaClassReferenceListElementType.java   
@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");
        }
      }
    }
  }
}
项目:intellij-ce-playground    文件:JavaClassElementType.java   
@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());
    }
  }
}
项目:tools-idea    文件:JavaClassReferenceListElementType.java   
@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");
        }
      }
    }
  }
}
项目:tools-idea    文件:JavaClassElementType.java   
@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());
    }
  }
}
项目:consulo-csharp    文件:CSharpTypeStubElementType.java   
@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());
    }
}
项目:consulo-dotnet    文件:DotNetNamespaceStubUtil.java   
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);
    }
}
项目:consulo-dotnet    文件:MsilClassStubElementType.java   
@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);
    }
}
项目:consulo-javascript    文件:JSQualifiedStubElementType.java   
@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);
    }
}
项目:lua-for-idea    文件:LuaStubCompoundIdentifierType.java   
@Override
public void indexStub(LuaCompoundIdentifierStub stub, IndexSink sink) {
    String name = stub.getName();

    if (StringUtil.isNotEmpty(name) && stub.isGlobalDeclaration()) {
      sink.occurrence(LuaGlobalDeclarationIndex.KEY, name);
    }
}
项目:lua-for-idea    文件:LuaStubModuleDeclarationType.java   
@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);
    }
}
项目:intellij-ce-playground    文件:JavaAnnotationElementType.java   
@Override
public void indexStub(@NotNull PsiAnnotationStub stub, @NotNull IndexSink sink) {
  String shortName = getReferenceShortName(stub.getText());
  if (!StringUtil.isEmptyOrSpaces(shortName)) {
    sink.occurrence(JavaStubIndexKeys.ANNOTATIONS, shortName);
  }
}
项目:intellij-ce-playground    文件:JavaFieldStubElementType.java   
@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());
    }
  }
}
项目:intellij-ce-playground    文件:PyTargetExpressionElementType.java   
@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);
  }
}
项目:intellij-ce-playground    文件:PyDecoratorCallElementType.java   
@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());
  }
}
项目:intellij-ce-playground    文件:ElementStubSerializer.java   
@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);
  }
}
项目:intellij-ce-playground    文件:GrMethodElementType.java   
@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);
    }
  }
}
项目:intellij-ce-playground    文件:GrFieldElementType.java   
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);
    }
  }
}
项目:intellij-ce-playground    文件:GrReferenceListElementType.java   
@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));
    }
  }
}
项目:consulo-unity3d    文件:ShaderDefStubElementType.java   
@Override
public void indexStub(@NotNull ShaderDefStub stub, @NotNull IndexSink sink)
{
    String name = stub.getName();
    if(name != null)
    {
        sink.occurrence(ShaderDefIndex.KEY, name);
    }
}
项目:intellij-haskforce    文件:HaskellNamedStubElementType.java   
@Override
public void indexStub(@NotNull S stub, @NotNull IndexSink sink) {
    final String name = stub.getName();
    if (name != null) {
        sink.occurrence(HaskellAllNameIndex.KEY, name);
    }
}
项目:tools-idea    文件:JavaMethodElementType.java   
@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());
    }
  }
}
项目:tools-idea    文件:JavaAnnotationElementType.java   
@Override
public void indexStub(@NotNull PsiAnnotationStub stub, @NotNull IndexSink sink) {
  String shortName = getReferenceShortName(stub.getText());
  if (!StringUtil.isEmptyOrSpaces(shortName)) {
    sink.occurrence(JavaStubIndexKeys.ANNOTATIONS, shortName);
  }
}
项目:tools-idea    文件:JavaFieldStubElementType.java   
@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());
    }
  }
}
项目:tools-idea    文件:GrMethodElementType.java   
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);
    }
  }
}
项目:tools-idea    文件:GrFieldElementType.java   
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);
    }
  }
}
项目:tools-idea    文件:GrReferenceListElementType.java   
public void indexStub(@NotNull GrReferenceListStub stub, @NotNull IndexSink sink) {
  for (String name : stub.getBaseClasses()) {
    if (name != null) {
      sink.occurrence(GrDirectInheritorsIndex.KEY, PsiNameHelper.getShortClassName(name));
    }
  }
}
项目:consulo-csharp    文件:CSharpMsilStubIndexer.java   
@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()));
}
项目:consulo-csharp    文件:CSharpMsilStubIndexer.java   
@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;
        }
    }
}
项目:consulo-csharp    文件:CSharpMethodStubElementType.java   
@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);
        }
    }
}
项目:consulo-csharp    文件:CSharpFieldStubElementType.java   
@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);
    }
}
项目:consulo-csharp    文件:CSharpPropertyElementType.java   
@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);
    }
}
项目:consulo-csharp    文件:CSharpEventElementType.java   
@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);
    }
}
项目:consulo-csharp    文件:CSharpEnumConstantStubElementType.java   
@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);
    }
}
项目:consulo-csharp    文件:CSharpTypeListElementType.java   
@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);
        }
    }
}
项目:consulo-lua    文件:LuaStubCompoundIdentifierType.java   
@Override
    public void indexStub(LuaCompoundIdentifierStub stub, IndexSink sink) {
//        String name = stub.getName();
//
//        if (StringUtil.isNotEmpty(name) && stub.isGlobalDeclaration()) {
//          sink.occurrence(LuaGlobalDeclarationIndex.KEY, name);
//        }
    }
项目:consulo-lua    文件:LuaStubGlobalDeclarationType.java   
@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);
    }
}
项目:consulo-lua    文件:LuaFieldStubType.java   
@Override
    public void indexStub(LuaFieldStub stub, IndexSink sink) {
//        String name = stub.getName();
//
//        if (name != null) {
//          sink.occurrence(LuaFieldIndex.KEY, name);
//        }
    }
项目:consulo-lua    文件:LuaStubModuleDeclarationType.java   
@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);
    }
}
项目:consulo-dotnet    文件:MsilMethodStubElementType.java   
@Override
public void indexStub(@NotNull MsilMethodEntryStub msilMethodEntryStub, @NotNull IndexSink indexSink)
{
    for(MsilStubIndexer indexer : MsilStubIndexer.EP_NAME.getExtensions())
    {
        indexer.indexMethod(msilMethodEntryStub, indexSink);
    }
}
项目:consulo-dotnet    文件:MsilTypeListStubElementType.java   
@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);
        }
    }
}