DescriptorFinder now can find class names in a package
This helps to get rid of "repeated class_name" field in Package protobuf message. DescriptorFinder in resolve.java uses PSI to find all classes in a package, and the finder for built-ins just reads .kotlin_class_names file
This commit is contained in:
@@ -55,9 +55,6 @@ public class KotlinPackageAnnotationTest extends CodegenTestCase {
|
||||
|
||||
PackageData data = JavaProtoBufUtil.readPackageDataFrom(kotlinPackage.data());
|
||||
|
||||
Set<String> classNames = collectClassNames(data);
|
||||
assertSameElements(Arrays.asList("A", "B", "C"), classNames);
|
||||
|
||||
Set<String> callableNames = collectCallableNames(data);
|
||||
assertSameElements(Arrays.asList("foo", "bar", "C"), callableNames);
|
||||
}
|
||||
@@ -71,13 +68,4 @@ public class KotlinPackageAnnotationTest extends CodegenTestCase {
|
||||
}
|
||||
return callableNames;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static Set<String> collectClassNames(@NotNull PackageData data) {
|
||||
Set<String> classNames = new HashSet<String>();
|
||||
for (int name : data.getPackageProto().getClassNameList()) {
|
||||
classNames.add(data.getNameResolver().getName(name).asString());
|
||||
}
|
||||
return classNames;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user