JSDoc comments for destructuring parameters not working in VSCode

大憨熊 提交于 2019-12-11 07:27:23

问题


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).


回答1:


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).


来源:https://stackoverflow.com/questions/50655416/jsdoc-comments-for-destructuring-parameters-not-working-in-vscode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!