Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there code commenting features like DocBlockr in Visual Studio Code?

I use Sublime Text 3, Atom.io, and Bracket.io as previous editors.

I am also really enjoying the new Visual Studio Code Editor for Mac.

Are there any code commenting features similar to DocBlockr for Sublime? This is quite crucial for me as I comment a hell of a lot of code.

like image 859
leogopal Avatar asked Apr 29 '15 20:04

leogopal


3 Answers

The Visual Studio Code Marketplace now has a doc block extension for JavaScript & others may be added soon. https://marketplace.visualstudio.com/items?itemName=stevencl.addDocComments


Formerly, it had partial support for this. As mentioned by others, you could get it by typing /** and then ENTER but only if you are in a JavaScript file. I don't believe it works in any other language.

A few similar features had been requested:

https://web.archive.org/web/20170910095011/https://visualstudio.uservoice.com/forums/293070-visual-studio-code/suggestions/9417975-intellisense-comments-need-improved-typedoc-and-j

https://web.archive.org/web/20170910095011/https://visualstudio.uservoice.com/forums/293070-visual-studio-code/suggestions/7899765-automatic-formatting-of-and-documentation

https://web.archive.org/web/20170910095011/https://visualstudio.uservoice.com/forums/293070-visual-studio-code/suggestions/8248872-true-jsdoc-support-for-ts-and-js

like image 170
mattferderer Avatar answered Sep 22 '22 06:09

mattferderer


It completes the block if you type /**[enter] and then any typing within the block is formatted (e.g. hit enter on a line beginning with a * and another is inserted below with a *).

But one really nice feature of DocBlockr is that it scans the code below and adds @param statements in the block. VS Code does not appear to do this.

like image 38
LetMyPeopleCode Avatar answered Sep 22 '22 06:09

LetMyPeopleCode


As of today, and release v1.1 there are not, however it is a highly voted feature. I would vote for this feature if you would find it useful, @mattferderer has posted the feature-links you should add your votes to. Until then, there are 2 plugins that work very well well used together:

Document This (ext install docthis) will generate JsDoc style comments for many JsDoc style annotations. Use command Ctrl + Alt + D on or inside of where you want to generate documentation.

This works well with the plugin "Complete JsDoc Tags"

Complete JsDoc Tags (ext install JSDocTagComplete) Provides code completion for most JsDoc style annotations using Ctrl + space.

Using these 2 plugins together works really efficiently. DocThis gives the initial generated comment with Ctrl + Alt + D, and can then use ctrl + space to add specific JsDoc annotations DocThis doesn't see/generate.

I didn't find the plugin "Add JsDoc Comments" @mattferderer mentions to be very useful. It only provides you with a @param and @return tag and nothing else...

like image 33
Prancer Avatar answered Sep 25 '22 06:09

Prancer