mozilla / sphinx-js

Autodoc-style extraction into Sphinx for your JS project
https://pypi.python.org/pypi/sphinx-js/
MIT License
282 stars 81 forks source link

Private class properties with the same name as public properties fail to be handled when both have jsdoc #242

Open Standard8 opened 4 months ago

Standard8 commented 4 months ago

With this code:

class foo {
  /**
   * My doc
   */
  #bar = [];

  /**
   * My other doc.
   * @param {array} values
   */
  set bar(values) {
    this.#bar = values;
  }

sphinx-js fails with:

sphinx_js.suffix_tree.PathsTaken: Your code contains multiple documented objects at each of these paths:

  ./myfile.foo#bar

We won't know which one you're talking about.

If I change the name of the setter or the private variable, then sphinx-js works.