File tree Expand file tree Collapse file tree 6 files changed +13
-10
lines changed Expand file tree Collapse file tree 6 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,8 @@ NS_REFINED_FOR_SWIFT
5353
5454@property (nonatomic) BOOL addIvarOffsetComments;
5555
56+ @property (nonatomic) BOOL expandIvarRecordTypeMembers;
57+
5658@end
5759
5860NS_HEADER_AUDIT_END (nullability)
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ - (id)copyWithZone:(NSZone *)zone {
2020 options.stripDtorMethod = _stripDtorMethod;
2121 options.addSymbolImageComments = _addSymbolImageComments;
2222 options.addIvarOffsetComments = _addIvarOffsetComments;
23+ options.expandIvarRecordTypeMembers = _expandIvarRecordTypeMembers;
2324 return options;
2425}
2526
Original file line number Diff line number Diff line change @@ -256,7 +256,7 @@ - (CDSemanticString *)semanticLinesWithOptions:(CDGenerationOptions *)options {
256256 [build appendString: @" \n " semanticType: CDSemanticTypeStandard];
257257 }
258258 [build appendString: @" " semanticType: CDSemanticTypeStandard];
259- [build appendSemanticString: [ivar semanticString ]];
259+ [build appendSemanticString: [ivar semanticStringWithOptions: options ]];
260260 [build appendString: @" ;" semanticType: CDSemanticTypeStandard];
261261 if (options.addIvarOffsetComments ) {
262262 [build appendString: [NSString stringWithFormat: @" // offset: %" PRIdPTR" " , ivar.offset] semanticType: CDSemanticTypeComment];
Original file line number Diff line number Diff line change 1010#import < objc/runtime.h>
1111
1212#import < ClassDumpRuntime/CDParseType.h>
13-
13+ # import < ClassDumpRuntime/CDGenerationOptions.h >
1414NS_HEADER_AUDIT_BEGIN (nullability)
1515
1616@interface CDIvarModel : NSObject
@@ -26,7 +26,7 @@ NS_HEADER_AUDIT_BEGIN(nullability)
2626- (instancetype )initWithIvar:(Ivar )ivar;
2727+ (instancetype )modelWithIvar:(Ivar )ivar;
2828
29- - (CDSemanticString *)semanticString ;
29+ - (CDSemanticString *)semanticStringWithOptions:(CDGenerationOptions *)options ;
3030
3131@end
3232
Original file line number Diff line number Diff line change @@ -21,16 +21,16 @@ - (instancetype)initWithIvar:(Ivar)ivar {
2121 _name = @(ivar_getName (ivar));
2222 _type = [CDTypeParser typeForEncoding: (ivar_getTypeEncoding (ivar) ?: " " )];
2323 _offset = ivar_getOffset (ivar);
24- if ([_type isKindOfClass: [CDRecordType class ]]) {
25- CDRecordType *recordType = (CDRecordType *)_type;
26- recordType.indentLevel = 1 ;
27- recordType.expand = YES ;
28- }
2924 }
3025 return self;
3126}
3227
33- - (CDSemanticString *)semanticString {
28+ - (CDSemanticString *)semanticStringWithOptions : (CDGenerationOptions *)options {
29+ if ([self .type isKindOfClass: [CDRecordType class ]] && options.expandIvarRecordTypeMembers ) {
30+ CDRecordType *recordType = (CDRecordType *)self.type ;
31+ recordType.indentLevel = 1 ;
32+ recordType.expand = YES ;
33+ }
3434 return [self .type semanticStringForVariableName: self .name];
3535}
3636
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ - (instancetype)initWithProperty:(objc_property_t)property isClass:(BOOL)isClass
101101 attributeName = @" copy" ;
102102 break ;
103103 case ' &' :
104- attributeName = @" retain " ;
104+ attributeName = @" strong " ;
105105 break ;
106106 case ' D' :
107107 isDynamic = YES ;
You can’t perform that action at this time.
0 commit comments