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

How do I @inheritDoc from a getter in v0.23? #1968

Closed
oliversalzburg opened this issue Jun 28, 2022 · 3 comments
Closed

How do I @inheritDoc from a getter in v0.23? #1968

oliversalzburg opened this issue Jun 28, 2022 · 3 comments
Labels
question Question about functionality

Comments

@oliversalzburg
Copy link

oliversalzburg commented Jun 28, 2022

Search terms

@inheritdoc, getter, update

Question

After updating to the latest version, my @inheritDoc usage causes warnings to be printed (and is ineffective). The project I'm working on is available on GitHub and a previously working usage is at https://github.com/oliversalzburg/plantdb/tree/d36454b25dea8d5530e24e92634c6c0020de23e3/packages/libplantdb/source/LogEntry.ts#L83

The warning for that line would be:

warning LogEntrySerialized.__type.id tried to copy a comment from @plantdb/libplantdb with @inheritdoc, but the source has no associated comment.

So how do I copy from the getters now or how should I restructure the code layout to not have to repeat these comments?

@oliversalzburg oliversalzburg added the question Question about functionality label Jun 28, 2022
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jun 28, 2022

Shoot, this is an edge case that slipped through...

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jun 29, 2022

In 0.23.3 TypeDoc will let you do this:

export class Foo {
    /** getter */
    get x() {
        return 1;
    }
    /** setter */
    set x(value: number) {
        throw new Error();
    }
}

export class Bar {
    /** {@inheritDoc Foo.x} */
    x = 1; // getter comment
    /** {@inheritDoc Foo.x:getter} */
    y = 2; // getter comment
    /** {@inheritDoc Foo.x:setter} */
    z = 3; // setter comment
}

Thought I'd be able to get this out today, but want to get #1966 in it too, so will be tomorrow

@oliversalzburg
Copy link
Author

Nice. I'll migrate once it's out and give it a go :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question about functionality
Projects
None yet
Development

No branches or pull requests

2 participants