【问题标题】:How do you view a function's documentation with Visual Studio Code's Intellisense?如何使用 Visual Studio Code 的 Intellisense 查看函数的文档?
【发布时间】:2017-12-26 09:38:41
【问题描述】:

我正在 Mac 上使用 Visual Studio Code 编写 Javascript。

我有这个功能,以JSDoc格式记录:

 /**
 * Adds the passed Matter Body to the simulation.
 * @param {Matter.Body} body - The body to add to the physics simulation
 * @param {string} imageUrl - The URL of the image to use to represent this body in the simulation. It should match an image URL that has already been added via loadImages()
 * @param {function} [onCollide] - Optional function to call when this body collides
 */
addObject(body, imageUrl, onCollide) {

但是,当 Intellisense 工具提示弹出时,它看起来像这样:

这一切都乱七八糟,没有显示完整的文档。是否需要按下某种组合键才能在工具提示中显示完整的功能文档?

【问题讨论】:

  • Alt+F12 偷看对象定义...是这个意思吗?

标签: javascript visual-studio-code jsdoc


【解决方案1】:

事实上它从来没有,但这是故意的:

由于您还没有定义参数,您可以阅读有关第一个参数的文档。

如果您已经编写/定义了第一个参数和逗号,您可以阅读有关第二个参数的文档,...

这与 c#-methods 的行为类似。

试一试...

【讨论】:

    猜你喜欢
    • 2022-08-16
    • 1970-01-01
    • 2020-11-30
    • 2019-11-05
    • 2018-03-22
    • 1970-01-01
    • 2015-07-10
    • 1970-01-01
    • 2017-04-29
    相关资源
    最近更新 更多