-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Description
According to jsdoc/jsdoc#987 (comment), JSDoc for destructured function parameters should be possible:
/**
* My cool function.
*
* @param {Object} obj - An object.
* @param {string} obj.prop1 - Property 1.
* @param {string} obj.prop2 - Property 2.
*/
var fn = function ({prop1, prop2}) {
// Do something with prop1 and prop2
}
However, when invoking the function, while Intellisense appears to support properties inside the object param, there is no documentation for individual params inside the destructured object, and the property types are not honored (shown as any
instead):
If I set parameter defaults, Intellisense will support those, but will still ignore the types specified in the doc comment (notice that the JSDoc comment is not consistent with the function definition):
And in both cases, the entire object param is highlighted, but individual params inside it are not.
Is there a different way to write the JSDoc comment, or does support for destructured parameters need to be supported by VS Code as well?