steph643
steph643

Reputation: 2460

JSDoc comments for destructuring parameters not working in VSCode

According to the doc, JSDoc supports destructuring parameters:

/**
 * Assign the project to an employee.
 * @param {Object} employee - The employee who is responsible for the project.
 * @param {string} employee.name - The name of the employee.
 * @param {string} employee.department - The employee's department.
 */
Project.prototype.assign = function({ name, department }) {
    // ...
};

However, it doesn't work for me in VSCode (v1.23.1). Has anyone successfully tried this?

VSCode and TypeScript repos contain several posts about similar issues, but they are confusing and closed (example here).

Upvotes: 2

Views: 2874

Answers (1)

steph643
steph643

Reputation: 2460

This feature is supported from VSCode 1.24 only (TypeScript 2.9).

Situation as of now (VSCode 1.24.0):

  • Param type is parsed correctly, allowing for type checking.
  • Param description text doesn't show up in IntelliSense (issue reported here).

Upvotes: 3

Related Questions