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).
const p = new Project();
, typingp.assign(
shows me the JSDoc for theemployee
parameter. (And I see that it's destructured, though I don't see the documentation foremployee.name
and.department
.) Is that what you mean? (Interestingly: If you leave off the first@param
above, what you see when you typep.assign(
looks a lot like one would want...) – Mckim