Skip to content

Conversation

@pepone
Copy link
Member

@pepone pepone commented Nov 3, 2025

Fix #4570

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for "See Also" documentation sections in Swift and Python code generators. The implementation follows existing documentation patterns in both languages to properly render @see tags from Slice documentation comments.

Key changes:

  • Added formatSeeAlso method implementations for Swift and Python code generators to format see-also links
  • Integrated see-also sections into Swift doc comments using Swift's - See Also format
  • Integrated see-also sections into Python docstrings using reStructuredText format with proper section underlining
  • Updated Python link formatter to handle scope separators (:: and #) when formatting unresolved references

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
cpp/src/slice2swift/Main.cpp Added formatSeeAlso method to SwiftDocCommentFormatter
cpp/src/slice2swift/SwiftUtil.cpp Integrated see-also section rendering in Swift doc comments and fixed "Remark" format
cpp/src/slice2py/PythonUtil.h Added writeSeeAlso method declaration
cpp/src/slice2py/PythonUtil.cpp Implemented see-also section rendering in Python docstrings and improved link formatter for unresolved references

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@InsertCreativityHere InsertCreativityHere left a comment

Choose a reason for hiding this comment

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

Looks good to me!

Comment on lines 50 to 53
string formatSeeAlso(const string& rawLink, const ContainedPtr& source, const SyntaxTreeBasePtr& target) final
{
return Slice::Python::pyLinkFormatter(rawLink, source, target);
}

Choose a reason for hiding this comment

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

This isn't necessary, formatSeeAlso is default-implemented to call formatLink:

string
DocCommentFormatter::formatSeeAlso(const string& rawLink, const ContainedPtr& source, const SyntaxTreeBasePtr& target)
{
// Many languages don't support 'see-also' tags, so by default we map them to regular doc-links.
return formatLink(rawLink, source, target);
}

and indeed, this has the same implementation as formatLink.

Comment on lines 36 to 39
string formatSeeAlso(const string& rawLink, const ContainedPtr& source, const SyntaxTreeBasePtr& target) final
{
return Slice::Swift::swiftLinkFormatter(rawLink, source, target);
}

Choose a reason for hiding this comment

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

Also not necessary, will already re-use formatLink automatically.

@pepone pepone merged commit 990b810 into zeroc-ice:main Nov 4, 2025
28 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.

Map @see Tags in Python and Swift

3 participants