当前位置: 首页>>代码示例>>Java>>正文


Java IndexSink类代码示例

本文整理汇总了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");
        }
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:JavaClassReferenceListElementType.java

示例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());
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:JavaClassElementType.java

示例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());
	}
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:26,代码来源:CSharpTypeStubElementType.java

示例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);
	}
}
 
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:27,代码来源:DotNetNamespaceStubUtil.java

示例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);
	}
}
 
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:17,代码来源:MsilClassStubElementType.java

示例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);
	}
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:17,代码来源:JSQualifiedStubElementType.java

示例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);
    }
}
 
开发者ID:internetisalie,项目名称:lua-for-idea,代码行数:9,代码来源:LuaStubCompoundIdentifierType.java

示例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);
    }
}
 
开发者ID:internetisalie,项目名称:lua-for-idea,代码行数:12,代码来源:LuaStubModuleDeclarationType.java

示例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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:JavaAnnotationElementType.java

示例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());
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:JavaFieldStubElementType.java

示例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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:PyTargetExpressionElementType.java

示例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());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:PyDecoratorCallElementType.java

示例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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:ElementStubSerializer.java

示例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);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:GrMethodElementType.java

示例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);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:GrFieldElementType.java


注:本文中的com.intellij.psi.stubs.IndexSink类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。