reflect/protoreflect: add FileDescriptor.SourceLocations
This adds minimal support for preserving the source context information.
Change-Id: I4b3cac9690b7469ecb4e5434251a809be4d7894c
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/183157
Reviewed-by: Damien Neil <dneil@google.com>
diff --git a/internal/filedesc/placeholder.go b/internal/filedesc/placeholder.go
index eaf04ee..dbf2c60 100644
--- a/internal/filedesc/placeholder.go
+++ b/internal/filedesc/placeholder.go
@@ -11,10 +11,11 @@
)
var (
- emptyNames = new(Names)
- emptyEnumRanges = new(EnumRanges)
- emptyFieldRanges = new(FieldRanges)
- emptyFieldNumbers = new(FieldNumbers)
+ emptyNames = new(Names)
+ emptyEnumRanges = new(EnumRanges)
+ emptyFieldRanges = new(FieldRanges)
+ emptyFieldNumbers = new(FieldNumbers)
+ emptySourceLocations = new(SourceLocations)
emptyFiles = new(FileImports)
emptyMessages = new(Messages)
@@ -44,6 +45,7 @@
func (f PlaceholderFile) Enums() pref.EnumDescriptors { return emptyEnums }
func (f PlaceholderFile) Extensions() pref.ExtensionDescriptors { return emptyExtensions }
func (f PlaceholderFile) Services() pref.ServiceDescriptors { return emptyServices }
+func (f PlaceholderFile) SourceLocations() pref.SourceLocations { return emptySourceLocations }
func (f PlaceholderFile) ProtoType(pref.FileDescriptor) { return }
func (f PlaceholderFile) ProtoInternal(pragma.DoNotImplement) { return }