🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

Documenting getters and setters #64

Closed

Description

@IjzerenHein

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

Activity

  1. h13i32maru commented on Sep 3, 2015

    @h13i32maru
    Member

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

  2. IjzerenHein commented on Sep 3, 2015

    @IjzerenHein
    Author

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

  3. h13i32maru commented on Sep 6, 2015

    @h13i32maru
    Member
  4. IjzerenHein commented on Sep 6, 2015

    @IjzerenHein
    Author

    Awesome, will try =)

  5. IjzerenHein commented on Sep 6, 2015

    @IjzerenHein
    Author

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions