reflect/protoreflect: add helper methods to FieldDescriptor

Added API:
	FieldDescriptor.IsExtension
	FieldDescriptor.IsList
	FieldDescriptor.MapKey
	FieldDescriptor.MapValue
	FieldDescriptor.ContainingOneof
	FieldDescriptor.ContainingMessage

Deprecated API (to be removed in subsequent CL):
	FieldDescriptor.Oneof
	FieldDescriptor.Extendee

These methods help cleanup several common usage patterns.

Change-Id: I9a3ffabc2edb2173c536509b22f330f98bba7cf3
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/176977
Reviewed-by: Damien Neil <dneil@google.com>
diff --git a/internal/legacy/extension.go b/internal/legacy/extension.go
index 9174555..b700a7f 100644
--- a/internal/legacy/extension.go
+++ b/internal/legacy/extension.go
@@ -65,7 +65,8 @@
 
 	// Determine the parent type if possible.
 	var parent piface.MessageV1
-	if mt, _ := preg.GlobalTypes.FindMessageByName(xt.Descriptor().Extendee().FullName()); mt != nil {
+	messageName := xt.Descriptor().ContainingMessage().FullName()
+	if mt, _ := preg.GlobalTypes.FindMessageByName(messageName); mt != nil {
 		// Create a new parent message and unwrap it if possible.
 		mv := mt.New().Interface()
 		t := reflect.TypeOf(mv)
diff --git a/internal/legacy/file_test.go b/internal/legacy/file_test.go
index 9a9a3fc..c8d9af5 100644
--- a/internal/legacy/file_test.go
+++ b/internal/legacy/file_test.go
@@ -433,7 +433,7 @@
 					case "HasJSONName":
 						// Ignore this since the semantics of the field has
 						// changed across protoc and protoc-gen-go releases.
-					case "Oneof", "Extendee", "Enum", "Message":
+					case "ContainingOneof", "ContainingMessage", "Enum", "Message":
 						// Avoid descending into a dependency to avoid a cycle.
 						// Just record the full name if available.
 						//
@@ -442,6 +442,8 @@
 						if !v.IsNil() {
 							out[name] = v.Interface().(pref.Descriptor).FullName()
 						}
+					case "Oneof", "Extendee":
+						// TODO: Remove this.
 					default:
 						out[name] = m.Call(nil)[0].Interface()
 					}