Пример #1
0
  public Collection<ClassDescriptor> getJetClassesDescriptors(
      @NotNull Condition<String> acceptedShortNameCondition, @NotNull KotlinCodeAnalyzer analyzer) {
    Collection<ClassDescriptor> classDescriptors = new ArrayList<ClassDescriptor>();

    for (String fqName : JetFullClassNameIndex.getInstance().getAllKeys(project)) {
      FqName classFQName = new FqName(fqName);
      if (acceptedShortNameCondition.value(classFQName.shortName().getName())) {
        classDescriptors.addAll(
            ResolveSessionUtils.getClassDescriptorsByFqName(analyzer, classFQName));
      }
    }

    return classDescriptors;
  }
Пример #2
0
  @Override
  public void indexObject(PsiJetObjectStub stub, IndexSink sink) {
    String name = stub.getName();
    assert name != null;

    sink.occurrence(JetShortClassNameIndex.getInstance().getKey(), name);

    if (stub.isTopLevel()) {
      sink.occurrence(JetTopLevelShortObjectNameIndex.getInstance().getKey(), name);
    }

    FqName fqName = stub.getFQName();
    if (fqName != null) {
      sink.occurrence(JetFullClassNameIndex.getInstance().getKey(), fqName.getFqName());
    }

    recordClassOrObjectByPackage(stub, sink);
  }
Пример #3
0
  @Override
  public void indexClass(PsiJetClassStub stub, IndexSink sink) {
    String name = stub.getName();
    if (name != null) {
      sink.occurrence(JetShortClassNameIndex.getInstance().getKey(), name);
    }

    String fqn = stub.getQualifiedName();
    if (fqn != null) {
      sink.occurrence(JetFullClassNameIndex.getInstance().getKey(), fqn);
    }

    for (String superName : stub.getSuperNames()) {
      sink.occurrence(JetSuperClassIndex.getInstance().getKey(), superName);
    }

    recordClassOrObjectByPackage(stub, sink);
  }