How do you view a function's documentation with Visual Studio Code's Intellisense?

蓝咒 提交于 2021-01-28 05:16:51

问题


I'm writing Javascript with Visual Studio Code on a Mac.

I have this function, documented in JSDoc format:

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

However, when the Intellisense tooltip pops up it looks like this:

It's all jumbled up and not showing the full documentation. Is there some sort of key combo I need to press to display the full function documentation in the tooltip?


回答1:


In fact it never does, but this is intended:

In cause of the fact, that you don’t have a parameter defined yet, you can read the doc about the first parameter.

If you had written/defined the first parameter and a comma too, you could read the doc about the second one,...

It’s a similar behavior as with c#-methods.

Give it a try...



来源:https://stackoverflow.com/questions/46457873/how-do-you-view-a-functions-documentation-with-visual-studio-codes-intellisens

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