proto serialization
This commit is contained in:
+15
@@ -432,6 +432,21 @@ public class DescriptorSerializer {
|
||||
return builder;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public ProtoBuf.Package.Builder packagePartProto(@NotNull Collection<DeclarationDescriptor> members, @Nullable Function1<DeclarationDescriptor, Boolean> skip) {
|
||||
ProtoBuf.Package.Builder builder = ProtoBuf.Package.newBuilder();
|
||||
|
||||
for (DeclarationDescriptor declaration : sort(members)) {
|
||||
if (skip != null && skip.invoke(declaration)) continue;
|
||||
|
||||
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