Skip to content

Conversation

@hnrklssn
Copy link
Member

  • Explanation:
    Swift nodes imported from clang don't have doc comments carried over, but IDEs are clever enough to fetch the comments from the associated clang node. The swift node in the macro expansion from _SwiftifyImport doesn't have a clang node directly associated with it however.

This patch adds the same comment from the clang node to the _SwiftifyImport macro invocation node. Since the macro has access to this node, it can easily copy over its leading trivia.

For now the comment is not altered at all, meaning @param still remains even if the parameter is removed.

@hnrklssn hnrklssn requested a review from a team as a code owner May 20, 2025 15:15
@hnrklssn
Copy link
Member Author

@swift-ci please test

@hnrklssn hnrklssn requested a review from DougGregor May 20, 2025 15:16
@hnrklssn hnrklssn force-pushed the swiftify-doccoment-6.2 branch from 17221f1 to 3bbf785 Compare May 24, 2025 00:11
@hnrklssn
Copy link
Member Author

@swift-ci please test

@hnrklssn hnrklssn force-pushed the swiftify-doccoment-6.2 branch from 3bbf785 to c9d51aa Compare May 29, 2025 00:57
@hnrklssn
Copy link
Member Author

@swift-ci please test

Swift nodes imported from clang don't have doc comments carried over,
but IDEs are clever enough to fetch the comments from the associated
clang node. The swift node in the macro expansion from _SwiftifyImport
doesn't have a clang node directly associated with it however.

This patch adds the same comment from the clang node to the
_SwiftifyImport macro invocation node. Since the macro has access to
this node, it can easily copy over its leading trivia.

For now the comment is not altered at all, meaning @param still remains
even if the parmeter is removed.

rdar://151346977
(cherry picked from commit 6534b9b)
@hnrklssn hnrklssn force-pushed the swiftify-doccoment-6.2 branch from c9d51aa to 341ee51 Compare May 29, 2025 07:20
@hnrklssn
Copy link
Member Author

@swift-ci please test

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes!

@hnrklssn hnrklssn merged commit 509871e into swiftlang:release/6.2 May 30, 2025
5 checks passed
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.

3 participants