Github 242 - Fix missing import in generated .h and correct ns in designer.cs#243
Open
Prochy wants to merge 5 commits intodotnet:mainfrom
Open
Conversation
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
This PR improves how xcsync generates Objective-C / C# interop code and fixes a few related bugs in sync/watch behavior.
The main issue was that generated files were not always correct: some .h files were missing required imports, designer.cs could end up with the wrong namespace, and outlet/action parameter types were sometimes mapped incorrectly when Clang reported pointer-like types such as int*. On top of that, sync/watch gained an explicit types option so generated code can be more predictable when type inference is not enough.
What changed
Currently all action parameters types converted from XCode to C# were created as NSObject event though in a header file was a different type. It's user unfriendly so I extended with -e option (--explicit-types) not to break compatibility. Valid for sync/watch command
Added and expanded tests around the rewriter, type mapping, sync/watch commands, and generated files.
Issue addressed
The issue was that xcsync could generate code that was incomplete or inconsistent:
imports were sometimes missing from generated header files,
generated designer code could use the wrong namespace,
some action/outlet parameter types were inferred incorrectly,
and users had no way to force explicit generated types when needed.
Microsoft Reviewers: Open in CodeFlow