-
Notifications
You must be signed in to change notification settings - Fork 138
Add support for the @see
tag
#236
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
Changes from 2 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a97a4ac
Add support for the see tag
0xCLARITY 644ea51
Have a single way to use the `@see` tag with a `@link`
0xCLARITY b0b8fb5
Clarify spec based on conversation from https://github.com/microsoft/…
octogonz 1369369
rush change
octogonz 037635c
Update playground to render `@example` and `@see` blocks
octogonz cdf8640
Update tsdoc/src/details/StandardTags.ts
octogonz ffec98a
Merge pull request #1 from octogonz/octogonz/see-tag
0xCLARITY 47c17be
Mark appendSeeBlock() as internal
octogonz 738354c
Mark appendSeeBlock() as internal
octogonz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... this API feels weird to me. The original design is that the "core" tags (
Standardization.Core
) would get dedicated properties in theDocComment
API, and then all other tags would go into thecustomBlocks
array.But this has a downside that any code relying on
customBlocks
will get broken by an update that promotes a block to being "core". And we seem to need helpers likeappendSeeBlock()
for each property.Perhaps a better design would be to deprecate
customBlocks
and replace it with a collectionblocks
that simply includes ALL the blocks. Then helpers likeseeBlocks
would be a shorthand for something like this:@hbergren Do you like this design better? If so we can implement it in a separate PR.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking more closely at the code, it seems that
customBlocks
is also used by TSDocEmitter when rearranging the blocks into a normalized order. The summary/remarks/params/returns are ordered first, then all the "custom blocks" can be emitted afterwards. I feel like we can find a better design for that, which avoids this problem of breaking the API whenever we promote a tag to be standardized.But fixing that problem should probably be tackled separately from introducing
DocComment.blocks
to support the improvement proposed above.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think your proposed design is pretty solid. I'm happy to help implement that in a future PR.
How would that potentially work with
TSDocEmitter
? We ensure that thethis._blocks
property is ordered before it gets toTSDocEmitter
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's address this issue in a separate PR. When I started to prototype it, it has some design questions of its own. I am okay with temporarily introducing
appendSeeBlock()
to get this PR merged. We can mark the API as@internal
for now.