[ObjC] Small formatting tweaks.

Hopefully will make future edits a little easier.

clang-format doesn't do anything with `R"objc(` blocks, and we can't use `R"cc(`
blocks as that gets the ObjC code formatted wrong.

PiperOrigin-RevId: 608678538
pull/15895/head
Thomas Van Lenten 1 year ago committed by Copybara-Service
parent 4c6436ab44
commit dd87c9fc72
  1. 12
      src/google/protobuf/compiler/objectivec/field.cc
  2. 6
      src/google/protobuf/compiler/objectivec/oneof.cc

@ -300,9 +300,9 @@ void SingleFieldGenerator::GeneratePropertyDeclaration(
descriptor_);
}}},
R"objc(
$comments$
@property(nonatomic, readwrite) $property_type$$name$$ deprecated_attribute$;
)objc");
$comments$
@property(nonatomic, readwrite) $property_type$$name$$ deprecated_attribute$;
)objc");
if (WantsHasProperty()) {
printer->Emit(R"objc(
@property(nonatomic, readwrite) BOOL has$capitalized_name$$ deprecated_attribute$;
@ -358,9 +358,9 @@ void ObjCObjFieldGenerator::GeneratePropertyDeclaration(
descriptor_);
}}},
R"objc(
$comments$
@property(nonatomic, readwrite, $property_storage_attribute$, null_resettable) $property_type$$name$$storage_attribute$$ deprecated_attribute$;
)objc");
$comments$
@property(nonatomic, readwrite, $property_storage_attribute$, null_resettable) $property_type$$name$$storage_attribute$$ deprecated_attribute$;
)objc");
if (WantsHasProperty()) {
printer->Emit(R"objc(
/** Test to see if @c $name$ has been set. */

@ -70,9 +70,9 @@ void OneofGenerator::GeneratePublicCasePropertyDeclaration(
descriptor_);
}}},
R"objc(
$comments$;
@property(nonatomic, readonly) $enum_name$ $name$OneOfCase;
)objc");
$comments$;
@property(nonatomic, readonly) $enum_name$ $name$OneOfCase;
)objc");
printer->Emit("\n");
}

Loading…
Cancel
Save