Is there a way to generate JSDoc comments in Visual Studio Code

|▌冷眼眸甩不掉的悲伤 提交于 2020-07-04 10:00:29

问题


I am currently developing a NodeJS project and found out that there is no built in functionality to create JSDoc comments for functions/methods.

I am aware of the TypeScript definitions that exist but I couldn't really find anything to match what I need.

WebStorm, for example, has some pretty neat JSDoc functionalities. Can one somehow achieve a similar functionality?


回答1:


Visual Studio 1.10 is now able to generate JSDoc comments.

Just type /** above the function

See Also:

  • VS Code Docs > Languages > Javascript > JSDoc Support
  • VS Code February 2017 Release Notes > Auto JSDoc Comments



回答2:


I really like "Document This".

Installation

Launch VS Code Quick Open (⌘+P), paste the following command, and press enter.
ext install docthis

https://marketplace.visualstudio.com/items?itemName=joelday.docthis

It has some nice features like adding doc blocks to an entire file.




回答3:


Maybe give this JSDoc extension a try: https://marketplace.visualstudio.com/items/stevencl.addDocComments

You can install extensions in VS Code from View > Command Palette




回答4:


A related one.

I was finding for Visual Studio 2017 Community edition, below helped:

https://marketplace.visualstudio.com/items?itemName=MichaelObermeyer.DocStubsJs2017



来源:https://stackoverflow.com/questions/34220564/is-there-a-way-to-generate-jsdoc-comments-in-visual-studio-code

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