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

[api-extractor] Support @throws tag #1631

Closed
1 of 2 tasks
vidartf opened this issue Nov 18, 2019 · 5 comments · Fixed by #1632
Closed
1 of 2 tasks

[api-extractor] Support @throws tag #1631

vidartf opened this issue Nov 18, 2019 · 5 comments · Fixed by #1632

Comments

@vidartf
Copy link
Contributor

vidartf commented Nov 18, 2019

Is this a feature or a bug?

  • Feature
  • Bug

Tsdoc supports @throws (microsoft/tsdoc#175), but api-extractor still does not support it:

configuration.setSupportForTags(
[
StandardTags.alpha,
StandardTags.beta,
StandardTags.defaultValue,
StandardTags.deprecated,
StandardTags.eventProperty,
StandardTags.example,
StandardTags.inheritDoc,
StandardTags.internal,
StandardTags.link,
StandardTags.override,
StandardTags.packageDocumentation,
StandardTags.param,
StandardTags.privateRemarks,
StandardTags.public,
StandardTags.readonly,
StandardTags.remarks,
StandardTags.returns,
StandardTags.sealed,
StandardTags.virtual
],

I have no idea how much work it would be to add this, but it would be useful to have 😃

@octogonz
Copy link
Collaborator

It's pretty easy. :-) I think the implementation would be similar to @example.

Would you be interested to implement it?

@vidartf
Copy link
Contributor Author

vidartf commented Nov 18, 2019

Would you be interested to implement it?

Yes, but I would need to some guidance:

  • Is the list I added the right place to add it?
  • What are other key code locations to look at?

@octogonz
Copy link
Collaborator

  • Is the list I added the right place to add it?

Yup

  • What are other key code locations to look at?

The intended @throws usage is here: microsoft/tsdoc#175

Note that the class name is (optionally) specified as a {@link} on a separate line.

The code that renders @example is here

If you need to visualize the AST, use this tool: https://microsoft.github.io/tsdoc/

Instructions for debugging API Extractor are here: https://api-extractor.com/pages/contributing/building/

For testing your change, use this project: https://github.com/microsoft/rushstack/tree/master/build-tests/api-documenter-test

@vidartf
Copy link
Contributor Author

vidartf commented Nov 19, 2019

So, as far as I am reading you:

  • The warning that was previously issued from api-extractor was a hint that the default renderer of api-documenter does not support the @throws tag.
  • The main work for a PR would be to add support for the tag in api-documenter's markdown renderer.

Correct?

@octogonz
Copy link
Collaborator

Yup!

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 a pull request may close this issue.

2 participants