如何使用Visual Studio Code的Intellisense查看函数的文档?

时间:2017-09-27 21:59:57

标签: javascript visual-studio-code jsdoc

我正在使用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工具提示弹出时,它看起来像这样:

enter image description here

这一切都混乱了,没有显示完整的文档。是否需要按某种键组合来显示工具提示中的完整功能文档?

1 个答案:

答案 0 :(得分:0)

事实上它永远不会,但这是有意的:

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

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

这与c#-methods类似。

试一试......