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

Preserve original comments #36

Closed
angelolloqui opened this issue Nov 1, 2017 · 2 comments
Closed

Preserve original comments #36

angelolloqui opened this issue Nov 1, 2017 · 2 comments

Comments

@angelolloqui
Copy link
Owner

angelolloqui commented Nov 1, 2017

Current version transforms Swift code to an AST and then back to Kotlin, but the initial comments get removed.

A possible solution would be to look for all comments (contained in the TopDeclaration) and look for the closest node in the Swift code and place it next to the first corresponding Kotlin token. This strategy could result in comments wrongly placed in some circumstances, but should work OK on most cases.

@angelolloqui angelolloqui changed the title Preserve original comments and spacing Preserve original comments Nov 1, 2017
@prattcmp
Copy link

prattcmp commented Apr 6, 2018

Id just like to add this could be super useful for iOS devs communicating code to Android devs.

angelolloqui pushed a commit that referenced this issue Jun 22, 2018
angelolloqui added a commit that referenced this issue Jun 23, 2018
@angelolloqui
Copy link
Owner Author

Merged with 73a4c52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants