Skip to content

jsdoc doesn't correctly support namepath #28443

New issue

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

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

Already on GitHub? Sign in to your account

Closed
PavelPolyakov opened this issue Nov 9, 2018 · 1 comment
Closed

jsdoc doesn't correctly support namepath #28443

PavelPolyakov opened this issue Nov 9, 2018 · 1 comment
Labels
Duplicate An existing issue was already created

Comments

@PavelPolyakov
Copy link

  • VSCode Version: 1.28.2
  • OS Version: macOS 10.14

Steps to Reproduce:

  1. Create a js file with this code:
// my-new-type.js

/**
 * MyNewType
 * @typedef {Object} MyNewType
 * @property {Factory~logFirst} logFirst
 * @property {Factory~logSecond} logSecond
 */

/**
 * MyNewType factory
 * @constructor
 * @param {number} first
 * @param {number} second
 * @returns MyNewType
 */
function Factory(first, second) {
  /**
   * logs first argument
   * @param {number} times
   */
  function logFirst(times) {
    for (let i = 0; i < times; i++) {
      console.log(first);
    }
  }

  /**
   * logs second argument
   * @param {number} times
   */
  function logSecond(times) {
    for (let i = 0; i < times; i++) {
      console.log(second);
    }
  }

  return {
    logFirst,
    logSecond
  };
}

module.exports = Factory;
  1. put the mouse over the MyNewType definition and see, that logFirst and logSecond are not defined:
    image

What is expected - definitions of these functions are taken directly from the Factory object's inner definitions. The syntax is correct, since if I do jsdoc my-file.js the generated documentation correctly links these types together:
image
Here is the namepath documentation: http://usejsdoc.org/about-namepaths.html

Does this issue occur when all extensions are disabled?: Yes

@vscodebot vscodebot bot assigned mjbvz Nov 9, 2018
@mjbvz mjbvz transferred this issue from microsoft/vscode Nov 9, 2018
@mjbvz mjbvz removed their assignment Nov 9, 2018
@mjbvz
Copy link
Contributor

mjbvz commented Nov 9, 2018

Support for @property is tracked by #15715

@mjbvz mjbvz closed this as completed Nov 9, 2018
@mjbvz mjbvz added the Duplicate An existing issue was already created label Nov 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants