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

Visual Studio-CodeJsdoc

Visual Studio-Code Problem Overview


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?

Visual Studio-Code Solutions


Solution 1 - Visual Studio-Code

Visual Studio 1.10 is now able to generate JSDoc comments.

Just type /** above the function

enter image description here

See Also:

Solution 2 - Visual Studio-Code

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=oouo-diogo-perdigao.docthis

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

Solution 3 - Visual Studio-Code

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

Install Extensions

Solution 4 - Visual Studio-Code

A related one.

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

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

Solution 5 - Visual Studio-Code

For anyone who, like me, is to lazy to type /** every time they want to insert some JSDoc comments I found the following solution to be quite effective. Note this is implemented with code-server 3.12.0

  1. Install the macros extension https://github.com/geddski/macros
  2. Add the following block to your settings.json
"macros": {
  "JSDoc": [
    {"command": "type", "args": {"text": "/**"}},
    "insertSnippet"
  ]
} 
  1. Add the following to your keybindings.json
{
  "key": "ctrl+shift+/",
  "command": "macros.JSDoc",
  "when": "editorFocus"
}

Now whenever you type ctrl+shift+/ intellisense autocomplete will pop-up, hit enter and enjoy.

Solution 6 - Visual Studio-Code

https://marketplace.visualstudio.com/items?itemName=kimlimjustin.jsdoc-generator

just select the whole function till the first block { and command vscode to generate jsdoc. works with arrow functions/typescript.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionzerefelView Question on Stackoverflow
Solution 1 - Visual Studio-CodeDominicView Answer on Stackoverflow
Solution 2 - Visual Studio-CodeJack VialView Answer on Stackoverflow
Solution 3 - Visual Studio-CodeBenjamin PaseroView Answer on Stackoverflow
Solution 4 - Visual Studio-CodeManohar Reddy PoreddyView Answer on Stackoverflow
Solution 5 - Visual Studio-CodeCorky3892View Answer on Stackoverflow
Solution 6 - Visual Studio-CodeAshu SahuView Answer on Stackoverflow