gpt4 book ai didi

javascript - JSDoc 对在 VSCode 中不起作用的解构参数的评论

转载 作者:行者123 更新时间:2023-11-30 20:28:08 24 4
gpt4 key购买 nike

根据 the doc , JSDoc 支持解构参数:

/**
* 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 }) {
// ...
};

但是,它在 VSCode (v1.23.1) 中对我不起作用。有人试过成功吗?

VSCode 和 TypeScript 存储库包含几篇关于类似问题的帖子,但它们令人困惑且已关闭(示例 here)。

最佳答案

只有 VSCode 1.24 (TypeScript 2.9) 支持此功能。

目前情况(VSCode 1.24.0):

  • Param 类型被正确解析,允许 type checking .
  • Param 描述文本未显示在 IntelliSense 中(已报告问题 here)。

关于javascript - JSDoc 对在 VSCode 中不起作用的解构参数的评论,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50655416/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com