|
|
|
@ -422,7 +422,8 @@ namespace Google.Protobuf.Reflection |
|
|
|
|
GeneratedClrTypeInfo generatedCodeInfo) |
|
|
|
|
{ |
|
|
|
|
ExtensionRegistry registry = new ExtensionRegistry(); |
|
|
|
|
AddAllExtensions(dependencies, generatedCodeInfo, registry); |
|
|
|
|
registry.AddRange(GetAllExtensions(dependencies, generatedCodeInfo)); |
|
|
|
|
|
|
|
|
|
FileDescriptorProto proto; |
|
|
|
|
try |
|
|
|
|
{ |
|
|
|
@ -445,9 +446,9 @@ namespace Google.Protobuf.Reflection |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static void AddAllExtensions(FileDescriptor[] dependencies, GeneratedClrTypeInfo generatedInfo, ExtensionRegistry registry) |
|
|
|
|
private static IEnumerable<Extension> GetAllExtensions(FileDescriptor[] dependencies, GeneratedClrTypeInfo generatedInfo) |
|
|
|
|
{ |
|
|
|
|
registry.AddRange(dependencies.SelectMany(GetAllDependedExtensions).Concat(GetAllGeneratedExtensions(generatedInfo)).ToArray()); |
|
|
|
|
return dependencies.SelectMany(GetAllDependedExtensions).Distinct().Concat(GetAllGeneratedExtensions(generatedInfo)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static IEnumerable<Extension> GetAllGeneratedExtensions(GeneratedClrTypeInfo generated) |
|
|
|
|