Commit Graph
4 Commits
Author SHA1 Message Date
Alex Tumanov 62094a7626 fix: preserve attributed Objective-C enum members
Allow clean enumerator attributes while keeping unsupported preprocessor bodies fail-closed.

AI-Assistance: OpenAI Codex
(cherry picked from commit 0f59982d5e)
2026-10-13 11:14:16 +01:00
Alex Tumanov 810a02ef28 fix: reject incomplete Objective-C enum macro parses
Validate both complete argument spans and reject unsupported body children instead of emitting partial enum graphs.

AI-Assistance: OpenAI Codex
(cherry picked from commit 7c09b4d360)
2026-10-13 11:14:16 +01:00
Alex Tumanov 61b43f5e91 feat: extract Objective-C enum macros
Extract NS_ENUM and NS_OPTIONS typedefs in Objective-C files using isolated enum body parsing and original member locations.

Fixes #4400

AI-Assistance: OpenAI Codex
(cherry picked from commit d6a74da475)
2026-10-13 11:14:16 +01:00
rajatnagda45 e4c48bf97e fix(objc): extract C-style enum declarations
Objective-C is an object-oriented extractor that already emits @interface,
@implementation and @protocol type nodes, but plain `enum` and
`typedef enum` definitions were dropped entirely: both the enum type and all
of its enumerators were invisible in the graph.

Handle `enum_specifier` (and the `typedef enum { ... } Name;` form, where the
name is the typedef alias), emitting a type node plus a node and `case_of` edge
per enumerator — the same shape every other language with enums uses (Java
#1719, C++ #3939, Swift). A nameless enum and a bodyless `enum X y;` reference
are skipped so no phantom node is minted.

NS_ENUM/NS_OPTIONS is deliberately out of scope: it is a macro call that
tree-sitter-objc parses into an ERROR subtree, so there is no clean AST to
read. Documented in the test.

Add regression tests for the plain, typedef, and skip cases.

(cherry picked from commit 2d30c413d3)
2026-10-05 19:40:03 +01:00