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

track inner indentation for doxygen commands #118

Merged
merged 3 commits into from
Apr 6, 2023

Conversation

QuietMisdreavus
Copy link
Contributor

@QuietMisdreavus QuietMisdreavus commented Apr 4, 2023

Bug/issue #, if applicable: rdar://107580214

Summary

The initial implementation of Doxygen commands didn't track trailing indentation, i.e. if trailing lines of the description were indented more than the command. This PR adds that tracking, so that commands will be parsed properly if the description text is indented relative to the command name.

The tracking is done similarly to block directive indentation tracking: The first line of the description that trails past the command name sets the indentation for the rest of the description. This is then used to create the offset for parsing the description as a whole.

Dependencies

None

Testing

Use the following markdown:

Method description.

@param thing
    The thing.
 @param otherThing
    The other thing.

Steps:

  1. Save the above markdown as test.md.
  2. swift run markdown-tool dump-tree --parse-block-directives --experimental-parse-doxygen-commands test.md
  3. Compare the output to below:
Document
├─ Paragraph
│  └─ Text "Method description."
├─ DoxygenParameter parameter: thing
│  └─ Paragraph
│     └─ Text "The thing."
└─ DoxygenParameter parameter: otherThing
   └─ Paragraph
      └─ Text "The other thing."

Checklist

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

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

@QuietMisdreavus
Copy link
Contributor Author

@swift-ci Please test

@QuietMisdreavus
Copy link
Contributor Author

@swift-ci Please test

@QuietMisdreavus
Copy link
Contributor Author

@swift-ci Please test

@QuietMisdreavus
Copy link
Contributor Author

@swift-ci Please test macOS

@QuietMisdreavus QuietMisdreavus merged commit 528d49c into swiftlang:main Apr 6, 2023
@QuietMisdreavus QuietMisdreavus deleted the doxygen-indent branch April 6, 2023 14:45
QuietMisdreavus added a commit to QuietMisdreavus/swift-markdown that referenced this pull request Apr 6, 2023
QuietMisdreavus added a commit that referenced this pull request Apr 6, 2023
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