fix(objc): add cross-file call resolution and unary message parsing#420
Open
leishuai wants to merge 3 commits intosafishamsi:v4from
Open
fix(objc): add cross-file call resolution and unary message parsing#420leishuai wants to merge 3 commits intosafishamsi:v4from
leishuai wants to merge 3 commits intosafishamsi:v4from
Conversation
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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.
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.
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.