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

Documenting getters and setters #64

Closed
IjzerenHein opened this issue Aug 30, 2015 · 5 comments
Closed

Documenting getters and setters #64

IjzerenHein opened this issue Aug 30, 2015 · 5 comments

Comments

@IjzerenHein
Copy link

@IjzerenHein IjzerenHein commented Aug 30, 2015

Hi! First of all, great library, love the output it generates :)

Hey, I've got classes with getters and setters, like this:

export default class Label2 extends Surface {
  constructor(options) {
    super(options);
    this.text = (options && options.text) ? options.text : '';
  }

  /**
   * Text that is displayed in the label.
   *
   * @type {String}
   */
  get text() {
    return this._text;
  }

  set text(text) {
    text = text || '';
    if (this._text !== text) {
      this._text = text;
      // do stuff here
    }
  }
}

It generates this output:
image

It fails to document the getter/setter property, because this.text = (options && options.text) ? options.text : ''; exists in the constructor. When clicking on 'source' it points to the constructor code:

image

Am I doing it right? How can I fix this?

Cheers

@h13i32maru
Copy link
Member

@h13i32maru h13i32maru commented Sep 3, 2015

@IjzerenHein Hi! Thanks for this issue!
This is ESDoc bug 😓 I will try to fix it. Please wait a little.

@IjzerenHein
Copy link
Author

@IjzerenHein IjzerenHein commented Sep 3, 2015

No worries, let me know if I need to help with testing anything.
Cheers dude, and thanks for this awesome doc generator :)

@h13i32maru
Copy link
Member

@h13i32maru h13i32maru commented Sep 6, 2015

@h13i32maru h13i32maru closed this Sep 6, 2015
@IjzerenHein
Copy link
Author

@IjzerenHein IjzerenHein commented Sep 6, 2015

Awesome, will try =)

@IjzerenHein
Copy link
Author

@IjzerenHein IjzerenHein commented Sep 6, 2015

Awesome, works like a charm now :)))
Thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.