Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56217
Changelog: [Internal]
Doxygen may incorrectly cross-reference parameter names inside function
pointer types to member variables of the enclosing class. For example,
`void (*cb)(const void* data)` inside a class that has a `data` member
would produce `const void* Class::data` instead of
`const void* data` in the snapshot. This diff addresses two issues:
1. In `get_doxygen_params`, re-parse function pointer type strings
through `parse_type_with_argstrings` which delegates to
`_parse_single_argument` that already strips "::" from parameter
names.
2. In `parse_type_with_argstrings`, recognize complex declarator groups
starting with `*` or `&` (e.g. `*(*fp)(int)`) as non-argument-list
parenthesized sections, preventing incorrect name extraction from
nested function pointer declarators.
Reviewed By: cipolleschi
Differential Revision: D98118629
fbshipit-source-id: a8532e2adaec1dd2b50be8a20eae1068ac49d548
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56076
Changelog: [Internal]
Updates the C++ API snapshot generator to extract specializations from name when a member is created, instead of relying on the one stored in the name string.
It also makes out-of-class definitions of members to be skipped in the snapshot as those were essentially duplicated between their declaration inside the class, and the initialization outside of it.
Reviewed By: cipolleschi
Differential Revision: D96303740
fbshipit-source-id: d649cb04bd7370af55ce707d607a372d7b4115b4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56075
Changelog: [Internal]
Updates the parser to extract the template specializations from name string in order to avoid repeated operations on the name string.
Reviewed By: cipolleschi
Differential Revision: D96303732
fbshipit-source-id: 08ff8ba34522426adccd53129590c5a7d59e0438
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56033
Changelog: [Internal]
Currently, if the source code uses globally qualified identifiers, those will be kept in the snapshot without changes. Since in the output, everything is fully qualified, the leading `::` can be stripped from those.
Reviewed By: cortinico
Differential Revision: D95947334
fbshipit-source-id: 9592b00bd896679dda90ed56d32024b22752d2b7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55971
Changelog: [Internal]
Doxygen incorrectly transforms parameter names to references if they match a member. This diff strips the resulting invalid qualification from the type.
Reviewed By: cipolleschi
Differential Revision: D95548542
fbshipit-source-id: c1e475f10e07af6a4076336cab0d3cbe0da342e5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55929
Changelog: [Internal]
Adds support for identifier qualification when using template specializations and when inheriting from template objects.
Reviewed By: cortinico
Differential Revision: D95367957
fbshipit-source-id: 60f7057e3fa1c5fbc117ff03a50de43c2f0dc371
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55910
Normalizes angle bracket spacing in scope names for template specializations.
Doxygen encodes template specializations with spaces around angle brackets in compound names (e.g., `CSSDataTypeParser< CSSMatrix >`). This caused inconsistent output in API snapshots.
The fix applies `normalize_angle_brackets()` to qualified paths when parsing scope names, ensuring consistent output:
- `CSSDataTypeParser< CSSMatrix >` → `CSSDataTypeParser<CSSMatrix>`
- `Callback< R(Args...)>` → `Callback<R(Args...)>`
Added a new test case `should_normalize_template_specialization_angle_brackets` to verify the fix.
Changelog:
[Internal]
Reviewed By: cipolleschi
Differential Revision: D95204780
fbshipit-source-id: d0d5fe7759a414b32630647f334b39e26da15108
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55898
Normalize Objective-C nullability annotations in the cxx-api parser to ensure consistent output in API snapshots.
Objective-C has three different forms of nullability annotations that are semantically equivalent:
- `nonnull`/`nullable` (context-sensitive keywords)
- `_Nonnull`/`_Nullable` (type qualifiers)
- `__nonnull`/`__nullable` (legacy Apple macros)
This diff normalizes all forms to `_Nonnull`/`_Nullable` for consistency.
**Examples:**
- `nonnull NSString*` → `_Nonnull NSString*`
- `NSString* __nonnull` → `NSString* _Nonnull`
- `nullable id` → `_Nullable id`
- `id __nullable` → `id _Nullable`
- `NSString* _Nonnull` → `NSString* _Nonnull` (unchanged)
Added a test case to verify the normalization works correctly.
Changelog:
[Internal]
Reviewed By: cortinico
Differential Revision: D95195669
fbshipit-source-id: ca2afd14b3c8bf7e62864daf9c3848f5d713898e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55901
Fixes inconsistent spacing around pointer (`*`) and reference (`&`, `&&`) symbols in the parser output.
Doxygen outputs types with a space before `*` and `&` (e.g., `NSString *`), which is inconsistent. This diff adds `normalize_pointer_spacing()` to standardize the output:
- `NSString *` → `NSString*`
- `int &` → `int&`
- `T &&` → `T&&`
- For function arguments: `NSString *name` → `NSString* name`
## Changes
1. Added `normalize_pointer_spacing()` function in `text_resolution.py`
2. Applied normalization in `resolve_ref_text_name()` and `resolve_linked_text_name()`
3. Applied normalization to block property argsstrings in `builders.py`
4. Updated all affected snapshot files to use normalized spacing
Changelog:
[Internal]
Reviewed By: cortinico
Differential Revision: D95078214
fbshipit-source-id: 1a21361565fd7915a3a597ac729cecc2cfe99961
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55909
Changelog: [Internal]
Restores the single path for doxygen ref parsing that was lost in refactor in D94072940
Reviewed By: cipolleschi
Differential Revision: D95206764
fbshipit-source-id: c2028872d8ff904187b41baf113dfe828796edcc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55772
The `main.py` increases rapidly in size. This diff refactors that into the `utils.py` and `builder.py` to form more modularized and easier to read structure.
Changelog:
[Internal]
Reviewed By: cipolleschi
Differential Revision: D94072940
fbshipit-source-id: f4b7b3c3bf4e2cf387829ced039d5645e2ad4b3e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55766
This diff adds support for parsing Objective-C protocols in the C++ API snapshot parser. The angle bracket normalization is also added to ensure better snapshot structure.
Changelog:
[Internal]
Reviewed By: cipolleschi
Differential Revision: D93859440
fbshipit-source-id: 21c4a47e33df0c61e738e07c5b56cfccd56af1a4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55843
Changelog: [Internal]
Adds explicit support for friend classes in the C++ API snapshot. Doxygen treats friends as variables of type "friend". For the snapshot use case, we cover that special case and store them as explicit `FriendMember`. This allows for correctly ignoring friend definitions when qualifying identifiers.
Reviewed By: cipolleschi
Differential Revision: D94901510
fbshipit-source-id: fd2f8d7798eee2bfb5778a0969cf77d20d9978a7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55697
Changelog: [Internal]
Implements fallback name qualification for cases where doxygen doesn't extract the full qualified name, and instead passes on the string it found in the header file.
- Adds type_qualification.py with qualify_type_str(), qualify_arguments(), and qualify_parsed_type()
- Updates member.py with close() methods for VariableMember, FunctionMember, and TypedefMember to apply type qualification
- Updates main.py with get_doxygen_params() to extract structured parameter info
Reviewed By: cipolleschi
Differential Revision: D94077825
fbshipit-source-id: 2265f5573164af1af129014082fc44fb8fceb135
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55698
Changelog: [Internal]
Refactors utils.py into a proper package structure and adds comprehensive argument string parsing utilities.
- Converts utils.py to utils/ package with submodules
- Adds argument_parsing.py with parse_arg_string() and related utilities
- Adds qualified_path.py with parse_qualified_path moved from old utils.py
- Renames test_member.py to test_parse_arg_string.py with updated tests for the new 4-tuple Argument format
Reviewed By: cipolleschi
Differential Revision: D94077819
fbshipit-source-id: 460d7a44e6d3e55580d996877ca63fa0c777bc23