milesj / docusaurus-plugin-typedoc-api

Docusaurus plugin that provides source code API documentation powered by TypeDoc.
69 stars 25 forks source link

Support for `@throws` #61

Closed jan-molak closed 2 years ago

jan-molak commented 2 years ago

Hey @milesj! It would be great if docusaurus-plugin-typedoc-api supported rendering information about the errors a method @throws

/**
 * @throws {@link UserError} if `max < min`
 */
export function rand(min: number, max: number): number;

At the moment, both @throws {CustomError} and @throws {@link CustomError} seem to be ignored.

milesj commented 2 years ago

@jan-molak Not a bad idea.

Does it not render at all below the comments though?

jan-molak commented 2 years ago

Not at the moment, here's my TSDoc:

   /**
     * Gives this Actor a list of {@link Ability|abilities} they can use
     * to interact with the system under test or the test environment.
     *
     * @param abilities
     *  A vararg list of abilities to give the actor
     *
     * @returns
     *  The actor with newly gained abilities
     *
     * @throws {@link ConfigurationError}
     *  Throws a ConfigurationError if the actor already has an ability of this type.
     */
    whoCan(...abilities: Ability[]): Actor {

and here's the rendering:

Screenshot 2022-08-05 at 19 55 02
milesj commented 2 years ago

@jan-molak Awesome, thanks, will look into.

milesj commented 2 years ago

These should render now.

jan-molak commented 2 years ago

And they do, thank you!

Screenshot 2022-08-21 at 10 43 16