Skip to content

Add support for Doxygen abstract tag #227

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

Merged
merged 4 commits into from
May 28, 2025

Conversation

binamaniar
Copy link
Contributor

@binamaniar binamaniar commented May 8, 2025

Bug/issue #, if applicable: Related to rdar://147920933

Summary

This PR adds support for parsing the Doxygen @abstract tags. See also: swiftlang/swift-docc#1215

Dependencies

None; the PR to swift-docc depends on this PR.

Testing

Create a documentation comment containing @abstract

This is an overview.

@abstract This is a description of abstract tag

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • [yes] Added tests
  • [ yes] Ran the ./bin/test script and it succeeded
  • [ na] Updated documentation if necessary

@binamaniar binamaniar marked this pull request as draft May 8, 2025 06:42
@binamaniar binamaniar changed the title [WIP] rdar://147920933 (Support HeaderDoc tag) [WIP] Add support for Doxygen abstract tag May 9, 2025
@binamaniar
Copy link
Contributor Author

@swift-ci please test

@binamaniar binamaniar changed the title [WIP] Add support for Doxygen abstract tag Add support for Doxygen abstract tag May 9, 2025
@binamaniar binamaniar marked this pull request as ready for review May 9, 2025 06:27
@patshaughnessy
Copy link

@swift-ci please test

Copy link

@patshaughnessy patshaughnessy 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 👍

Copy link
Contributor

@QuietMisdreavus QuietMisdreavus left a comment

Choose a reason for hiding this comment

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

This looks great, thanks!

@binamaniar binamaniar force-pushed the support_abstract_headerdoc branch from d0ad98f to 3f9b8b5 Compare May 12, 2025 20:50
…s with only an abstract retains its documentation
@binamaniar binamaniar force-pushed the support_abstract_headerdoc branch from 3f9b8b5 to 319fb59 Compare May 12, 2025 21:12
…s with abstract headerdoc tag retains documentation
@binamaniar binamaniar force-pushed the support_abstract_headerdoc branch from 319fb59 to 2f24da8 Compare May 13, 2025 05:56
@binamaniar
Copy link
Contributor Author

@swift-ci please test.

@binamaniar
Copy link
Contributor Author

@swift-ci please test

@@ -887,6 +892,8 @@ struct ParseContainerStack {
kind = .discussion
case "note":
kind = .note
case "abstract":
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we also support the "brief" name here? (assuming that this is where the tag name is mapped to a kind)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes this is where the mapping is, should that be a separate pr ? open to add here as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

If all it would take is one more string literal on this line and possibly a test that verifies that it works, then it might be worth doing in the same PR. If it's any more than that it seems to me like it would be better to add in a follow-up PR. What do you think @QuietMisdreavus?

Copy link
Contributor Author

@binamaniar binamaniar May 28, 2025

Choose a reason for hiding this comment

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

I will wait till tomorrow to hear back on this. @d-ronnqvist @QuietMisdreavus shall I go ahead with merging this and have a separate pr for brief? Brief would need a mapping as well as @brief to be processed same as @abstract. Please let me know whatever you prefer, I would like to incorporate feedback soon.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should go ahead and add support for @brief here, the same as the case "return", "returns", "result" line below this one. All you should need is to add the "brief" check here and copy/paste a test with the new command name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

great doing it now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done please see latest commit. @QuietMisdreavus

Copy link
Contributor

Choose a reason for hiding this comment

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

Awesome, looks great!

@QuietMisdreavus
Copy link
Contributor

@swift-ci Please test

@patshaughnessy patshaughnessy merged commit 5ad49ed into swiftlang:main May 28, 2025
2 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.

4 participants