Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

Use of JSDoc inheritdoc tag produces build failures due to multiple documented objects #128

Open
aaclayton opened this issue Dec 21, 2019 · 1 comment

Comments

@aaclayton
Copy link

aaclayton commented Dec 21, 2019

An annotation which includes the @inheritdoc tag should be ignored, with documentation derived from the parent class.

https://jsdoc.app/tags-inheritdoc.html

Example

class A {
  /**
   * This method returns a number
   * @param {number} x
   * @return {number}
   */
  foo(x) {
    return x;
  }
}

class B extends A {
  /** @inheritdoc */
  foo(x) {
    return x+1;
  }
}

When building jsdoc directly, this works as intended, but when building using sphinx-js it results in the following failure:

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

  ./jspath.B#foo

We won't know which one you're talking about. Using JSDoc tags like @class might help you differentiate them.

Since this is a core jsdoc tag, it should be also supported by sphinx-js.
Issue is related to #110

@erikrose
Copy link
Contributor

Yes, we should at least not crash when somebody uses that tag. :-) Patch welcome! #111 may also be a useful hack around this problem in the meantime.

hoodmane added a commit to hoodmane/sphinx-js that referenced this issue May 2, 2024
This is a repeat of mozilla#101 which we dropped when rewriting in typescript. This
time I added a test.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants