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

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

Loading…
Cancel
Save