code: private static FieldRef getExtensionField(FieldDescriptor descriptor) {
      Preconditions.checkArgument(descriptor.isExtension(), "%s is not an extension", descriptor);
      String extensionFieldName = getFieldName(descriptor, false);
      if (descriptor.getExtensionScope() != null) {
        TypeInfo owner = messageRuntimeType(descriptor.getExtensionScope());
        return FieldRef.createPublicStaticField(owner, extensionFieldName, EXTENSION_TYPE);
      }
      // else we have a 'top level extension'
      String containingClass =
          JavaQualifiedNames.getPackage(descriptor.getFile())
              + "."
              + JavaQualifiedNames.getOuterClassname(descriptor.getFile());
      return FieldRef.createPublicStaticField(
          TypeInfo.create(containingClass), extensionFieldName, EXTENSION_TYPE);
    }
docs: Returns the {@link FieldRef} for the generated {@link Extension} field.