Skip to content

Fix parsing of Objective-C block properties#55776

Open
coado wants to merge 9 commits intofacebook:mainfrom
coado:export-D94366205
Open

Fix parsing of Objective-C block properties#55776
coado wants to merge 9 commits intofacebook:mainfrom
coado:export-D94366205

Conversation

@coado
Copy link
Contributor

@coado coado commented Feb 26, 2026

Summary:
Doxygen splits block property types across <type> and <argsstring> elements. For example:

property (nonatomic, copy) void (^eventInterceptor)(NSString *eventName, NSDictionary *event, NSNumber *reactTag);

Produces XML like:

<type>void(^</type>
<name>eventInterceptor</name>
<argsstring>)(NSString *eventName, NSDictionary *event, NSNumber *reactTag)</argsstring>

This caused the parser to output incomplete types. The fix detects when the property type ends with (^ and combines it with the property name and argsstring:

property (copy) void(^eventInterceptor)(NSString *eventName, NSDictionary *event, NSNumber *reactTag);

Reviewed By: cipolleschi

Differential Revision: D94366205

Dawid Małecki and others added 9 commits February 26, 2026 03:21
Differential Revision: D93859440
Differential Revision: D94071995
Differential Revision: D94072940
Differential Revision: D94076350
Summary:
Doxygen adds spaces inside angle brackets in its XML output:
- Outputs: `std::vector< PropNameID >`
- Expected: `std::vector<PropNameID>`

The solution is to apply `normalize_angle_brackets()` in `resolve_ref_text_name()` to normalize spacing consistently.

Differential Revision: D94232505
Summary:
Adding test for parsing interfaces with deprecated attributes and extending the doxygen test config with `__attribute__` predefined macro.

## Changelog:
[Internal]

Differential Revision: D94343118
Summary:
Doxygen incorrectly parses Objective-C interface declarations with protocol conformance. For example:

```objc
interface RCTAppearance : RCTEventEmitter <RCTBridgeModule>
```

Doxygen splits this into **two separate base classes** in the XML:
```xml
<basecompoundref>RCTEventEmitter</basecompoundref>
<basecompoundref>&lt;RCTBridgeModule&gt;</basecompoundref>
```

This caused the parser to output:
```
interface RCTAppearance : public RCTEventEmitter, public <RCTBridgeModule> {
```

Instead of the expected:
```
interface RCTAppearance : public RCTEventEmitter <RCTBridgeModule> {
```

The fix detects when a "base class" name starts and ends with `<...>` (indicating it's a protocol conformance) and combines it with the preceding actual base class name.

Differential Revision: D94351731
Summary:
Doxygen splits block property types across `<type>` and `<argsstring>` elements. For example:

```objc
property (nonatomic, copy) void (^eventInterceptor)(NSString *eventName, NSDictionary *event, NSNumber *reactTag);
```

Produces XML like:
```xml
<type>void(^</type>
<name>eventInterceptor</name>
<argsstring>)(NSString *eventName, NSDictionary *event, NSNumber *reactTag)</argsstring>
```

This caused the parser to output incomplete types. The fix detects when the property type ends with `(^` and combines it with the property name and argsstring:
```
property (copy) void(^eventInterceptor)(NSString *eventName, NSDictionary *event, NSNumber *reactTag);
```

Reviewed By: cipolleschi

Differential Revision: D94366205
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 26, 2026
@facebook-github-bot facebook-github-bot added p: Software Mansion Partner: Software Mansion Partner p: Facebook Partner: Facebook labels Feb 26, 2026
@meta-codesync
Copy link

meta-codesync bot commented Feb 26, 2026

@coado has exported this pull request. If you are a Meta employee, you can view the originating Diff in D94366205.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported p: Facebook Partner: Facebook p: Software Mansion Partner: Software Mansion Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants