コード例 #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
  /** Return jet class names form jet project sources which should be visible from java. */
  @NotNull
  @Override
  public String[] getAllClassNames() {
    Collection<String> classNames = JetShortClassNameIndex.getInstance().getAllKeys(project);

    // .namespace classes can not be indexed, since they have no explicit declarations
    IDELightClassGenerationSupport lightClassGenerationSupport =
        IDELightClassGenerationSupport.getInstanceForIDE(project);
    Set<String> packageClassShortNames =
        lightClassGenerationSupport
            .getAllPackageClasses(GlobalSearchScope.allScope(project))
            .keySet();
    classNames.addAll(packageClassShortNames);

    return ArrayUtil.toStringArray(classNames);
  }