Skip to content

Interface comments are ignored #1391

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

Closed
ThibaultJanBeyer opened this issue Nov 1, 2020 · 8 comments
Closed

Interface comments are ignored #1391

ThibaultJanBeyer opened this issue Nov 1, 2020 · 8 comments

Comments

@ThibaultJanBeyer
Copy link

Unfortunately, I found another issue trying to generate documentation for my project:

Expected Behavior

When running typedocs over a class with interfaces in the constructor, I'd expect the comments to be displayed

Actual Behavior

No comments are displayed

Steps to reproduce the bug

Given:

interface Settings {
  /** some description */
  foo: string
}

class MyClass {
  constructor({ foo = 'bar' }: Settings) { ... }
}

The Typedocs output is

# constructor

    new MyClass(__namedParameters: { foo: string }): MyClass

     >   Defined in MyClass.ts:87

## Parameters
        __namedParameters: { foo: string }

           - foo: string

While the description is correctly displayed under the Settings Interface, in the Classes documentation it's not.
I'd either expect it to have the description from the interface taken over like:

- foo: string
some description

Or to have a reference to the interface something like this:

## Parameters
        __namedParameters: settings: Settings

 - settings: Settings

Environment

  • Typedoc version: "typedoc": "^0.19.2",
  • TypeScript version: "typescript": "^4.0.5"
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Nov 1, 2020

I believe this is a problem with typedoc-plugin-markdown - The default themes will render this as follows, with a link to the settings interface:

image

@ThibaultJanBeyer
Copy link
Author

ThibaultJanBeyer commented Nov 1, 2020

Thanks for your Answer @Gerrit0 but somehow, just using:

typedoc --out docs/ts --mode modules src

See:

Screenshot 2020-11-02 at 00 37 00

Screenshot 2020-11-02 at 00 36 53

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Nov 1, 2020

Oops... I checked on the 0.20 beta - this is another case of the bug linked in your other issue.

@ThibaultJanBeyer
Copy link
Author

Ah! All right, any plans when 0.20 will be released? :D

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Nov 2, 2020

That highly depends on how many issues are discovered - The current set of remaining things to do isn't that large, so I might be able to get it done in another couple of weeks. #1364 tracks what's being done.

That said, I am publishing betas, which will likely produce better output already than 0.19 (but might not work correctly with plugins - I'm almost certain I broke the markdown plugin since TypeDoc now supports more literal types than just string literals)

@ThibaultJanBeyer
Copy link
Author

All right, I don't really understand what you mean by the plugins but looking forward to the changes. Where can I get the beta releases?
Will close this issue then since it's addressed in the new version already as you say :)

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Nov 2, 2020

By plugins I mean packages like typedoc-plugin-markdown that add extra features to TypeDoc.

You can get betas with npm install typedoc@beta

@ThibaultJanBeyer
Copy link
Author

Thank you, will try it out!

@Gerrit0 Gerrit0 removed the bug label Feb 2, 2025
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

No branches or pull requests

2 participants