Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix generic Swift declaration generation from ObjC #449

Merged
merged 1 commit into from
Nov 29, 2017

Conversation

johnfairh
Copy link
Collaborator

Spotted by a patient jazzy user in realm/jazzy#910. When SourceKit produces the full_as_xml as part of a cursorinfo request for a decl imported from ObjC, it forgets to XML-escape the ‘Declaration’. SourceKitten had a fix for ‘&’ but not ‘<’ ‘>’ (generics) - causes truncation of the Swift decl.

This PR changes SourceKitten to always use the annotated_declaration_xml instead of trying to work around the Swift bug -- this XML is generated using different code that has always been escaped properly. For ObjC, the contents of the two declarations are identical.

Testcase change show Realm ObjC was suffering from this -- various generic declarations missing pieces in Swift.

@jpsim
Copy link
Owner

jpsim commented Nov 29, 2017

Excellent fix!

@jpsim jpsim merged commit 5114805 into jpsim:master Nov 29, 2017
@jpsim jpsim deleted the objc-swift-decls branch November 29, 2017 17:50
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.

2 participants