Skip to content

fix(objc): add cross-file call resolution and unary message parsing#420

Open
leishuai wants to merge 3 commits intosafishamsi:v4from
leishuai:fix/objc-cross-file-calls
Open

fix(objc): add cross-file call resolution and unary message parsing#420
leishuai wants to merge 3 commits intosafishamsi:v4from
leishuai:fix/objc-cross-file-calls

Conversation

@leishuai
Copy link
Copy Markdown

Summary

PR #298 extended cross-file call resolution ( raw_calls ) to Go, Rust, Zig, PowerShell, and Elixir. This PR applies the same pattern to Objective-C.

Changes

  1. Cross-file call resolution — extract_objc now populates raw_calls for unmatched method calls, enabling the extract() post-pass to resolve them globally and emit INFERRED confidence edges.

  2. Unary message parsing fix — The original walk_calls only checked selector and keyword_argument_list child types, missing unary messages like [self speak] where the method name is a plain identifier node. Added fallback logic.

  3. Accurate source location — Changed call edge source_location from body_node.start_point (entire method body) to n.start_point (exact message expression).

All 433 tests pass.

leishuai and others added 3 commits April 17, 2026 23:56
- Add raw_calls to extract_objc for cross-file call resolution via extract() post-pass
- Fix walk_calls to handle unary messages ([self speak] style) by falling back to identifier nodes
- Save unmatched calls to raw_calls for INFERRED edge generation
- Consistent with raw_calls pattern used in Go, Rust, Zig, PowerShell, Elixir (safishamsi#298)
…tion

ObjC method labels are prefixed with - (instance) or + (class), e.g. -speak.
The global cross-file resolution map used lstrip('.') which didn't remove these
prefixes, so raw_calls callees like 'speak' couldn't match '-speak' in the map.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant