Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[analyzer] Property defined in the mixin constructor does not have description and type definition #630

Closed
web-padawan opened this issue Aug 10, 2018 · 1 comment · Fixed by #676

Comments

@web-padawan
Copy link
Contributor

web-padawan commented Aug 10, 2018

In some of the components and mixins we have property definitions like this:

    constructor() {
      super();
      /**
       * Submittable string value. The default value is the trimmed text content of the element.
       * @type {string}
       */
      this.value;
    }
    get value() {
      return this._value !== undefined ? this._value : this.textContent.trim();
    }
    set value(value) {
      this._value = value;
    }

With latest polymer-cli it only works for elements, but not for mixins.

Before

"name": "value",
"type": "string",
"description": "Submittable string value. The default value is the trimmed text content of the element.",

Permalink:
https://github.com/vaadin/vaadin-item/blob/699c0c8ebb89f6004aa6de5a011b0a9294a23939/analysis.json#L26

After

"name": "value",
"type": "?",
"description": "",

Permalink:
https://github.com/vaadin/vaadin-item/blob/bd28f0b29b3fbd977fee1c0303abde4ef4aa1d65/analysis.json#L26

Note: the same JSDoc annotation in vaadin-checkbox element (not mixin) working fine with the latest analyzer in polymer-cli 1.7.7: https://github.com/vaadin/vaadin-checkbox/blob/e9af82ba9b6017af03d214d3a9286018f4beab5d/src/vaadin-checkbox.html#L158

@43081j
Copy link
Contributor

43081j commented Aug 10, 2018

FYI its because we overwrite the property when scanning the accessor.

Guess we should be merging instead of overwriting on second scan.

Happy to fix it once i figure how we should handle that.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants