Serialize packages via descriptors in codegen
Disable KotlinPackage annotation for scripts, otherwise script analyzer tries to add descriptors to a locked scope
This commit is contained in:
+13
@@ -379,6 +379,19 @@ public class DescriptorSerializer {
|
||||
return builder;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public ProtoBuf.Package.Builder packageProto(@NotNull NamespaceDescriptor descriptor) {
|
||||
ProtoBuf.Package.Builder builder = ProtoBuf.Package.newBuilder();
|
||||
|
||||
for (DeclarationDescriptor declaration : sort(descriptor.getMemberScope().getAllDescriptors())) {
|
||||
if (declaration instanceof PropertyDescriptor || declaration instanceof FunctionDescriptor) {
|
||||
builder.addMember(callableProto((CallableMemberDescriptor) declaration));
|
||||
}
|
||||
}
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static ProtoBuf.Type.Argument.Projection projection(@NotNull Variance projectionKind) {
|
||||
switch (projectionKind) {
|
||||
|
||||
Reference in New Issue
Block a user