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

[Regression] Documentation for destructured object properties is not picked up. #1770

Closed
canonic-epicure opened this issue Oct 29, 2021 · 4 comments
Labels
bug Functionality does not match expectation
Milestone

Comments

@canonic-epicure
Copy link
Contributor

Search terms

object destructuring, object properties

Description

This used to work in 0.17, but now it does not. For this setup, where the Sym1 and Sym2 a descructured properties of the object, the docs for them are not "picked up"

const api = () : {
    Sym1 : () => number,
    Sym2 : () => boolean
} => {
    return null
}

/**
 * Important constant
 */
export const {
    /**
     * Docs for Sym1
     */
    Sym1,

    /**
     * Docs for Sym2
     */
    Sym2
} = api()

Result is: image

And if you run the command line as: npx typedoc index.ts --excludeNotDocumented, the result is empty:
image

Reproduce

To reproduce:

@canonic-epicure canonic-epicure added the bug Functionality does not match expectation label Oct 29, 2021
@Gerrit0 Gerrit0 added this to To do in TSDoc - v0.23 via automation Nov 6, 2021
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Nov 6, 2021

I think I'm going to punt this one to 0.23 as well, since fixing it without making a significant breaking API change involves a ridiculous amount of hackery. There's a couple additional problems here, with the one making this immediately difficult to fix being that TypeDoc's checks for "has a comment" isn't consistent with whether or not TypeDoc will actually find a comment.

@canonic-epicure
Copy link
Contributor Author

Ok, cool, no rush, since its possible to workaround this one. It worked in 0.17, I guess need to check what approach was used there.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Nov 8, 2021

In 0.17, I'm pretty sure it worked because comments were always added to the parent function reflection, and then inherited to the signatures. That changed nearly a year ago now to fix... something... which broke this.

@canonic-epicure
Copy link
Contributor Author

I see. Worth pining with a test.

@Gerrit0 Gerrit0 moved this from To do to Done in TSDoc - v0.23 Feb 16, 2022
@Gerrit0 Gerrit0 added this to the v0.23 milestone Apr 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality does not match expectation
Projects
No open projects
Development

No branches or pull requests

2 participants