Files
graphify/tests
rajatnagda45 f893a6e2da fix(swift): extract macro declarations and resolve freestanding macro calls
Swift 5.9 macros were dropped entirely. `macro stringify(...) = #externalMacro(...)`
parses as a `macro_declaration` (freestanding or attached), which was in neither
`function_types` nor `class_types`, so the symbol never entered the graph. A
freestanding call `#stringify(...)` parses as a `macro_invocation`, not a
`call_expression`, so its call edge was lost too.

- Add `macro_declaration` to the Swift `function_types`. It has no `name` field,
  but the name is a bare `simple_identifier` child already covered by
  `name_fallback_child_types`, so the existing name resolution handles it; the
  generic `<T>` type parameter is excluded by the existing type-param scope pass
  (no `t` god node).
- Add `macro_invocation` to `call_types` and give it a callee branch in
  walk_calls: a freestanding macro is a free top-level symbol (resolved by bare
  name, no `self` receiver). Calls inside the macro's arguments
  (`#stringify(helper())`) still resolve because walk_calls recurses into the
  invocation's children.

Attached-macro *usage* (`@AddCompletion` on a type) is an attribute, not a
`macro_invocation`, so it is not linked to the macro — left unresolved
(fail-closed); the declaration itself is still extracted.
2026-10-20 10:35:25 +01:00
..