open-wc / custom-elements-manifest

Custom Elements Manifest is a file format that describes custom elements in your project.
https://custom-elements-manifest.open-wc.org/
226 stars 37 forks source link

properties initialized in the constructor don't get their JSDOC tags read #251

Closed KonnorRogers closed 1 month ago

KonnorRogers commented 2 months ago

Checklist

Completing the items above will greatly improve triaging time of your issue.

Expected behavior

I expect using /** @attr */ on a property in the constructor to get added to the custom-elements.json


import { LitElement } from 'lit-element';

export class MyElement extends LitElement {
  /**
   * This gets added as an attribute
   * @attr {number}
   */
  myBar = 0

  constructor () {
    super()
    /**
     * This doesn't get added as an attribute
     * @attr {number}
     */
    this.myFoo = 0
  }
}

Reproduction:

https://custom-elements-manifest.netlify.app/?source=CmltcG9ydCB7IExpdEVsZW1lbnQgfSBmcm9tICdsaXQtZWxlbWVudCc7CgpleHBvcnQgY2xhc3MgTXlFbGVtZW50IGV4dGVuZHMgTGl0RWxlbWVudCB7CiAgICAvKioKICAgICAqIFRoaXMgZ2V0cyBhZGRlZCBhcyBhbiBhdHRyaWJ1dGUKICAgICAqIEBhdHRyIHtudW1iZXJ9CiAgICAgKi8KICBteUJhciA9IDAKICBjb25zdHJ1Y3RvciAoKSB7CiAgICAgIHN1cGVyKCkKICAgIC8qKgogICAgICogVGhpcyBkb2Vzbid0IGdldCBhZGRlZCBhcyBhbiBhdHRyaWJ1dGUKICAgICAqIEBhdHRyIHtudW1iZXJ9CiAgICAgKi8KICAgIHRoaXMubXlGb28gPSAwCiAgfQp9Cg%3D%3D&library=litelement

thepassle commented 1 month ago

Fixed in #252