Is it possible, preferably, in Sublime Text or Webstorm, to type in a JSDoc-style comment, like so:
/**
* Repeat <tt>str</tt> several times.
* @param {string} str The string to repeat.
* @param {number} times How many times to repeat the string.
* @returns {string}
*/
And generate a function definition like so:
function repeat (str, times) {
return
}
?
A vice-versa operation is fine too, I'm just looking for a way to save on extra keystrokes.
It would appear that sublime-jsdocs
is just what you're looking for for ST2. Scroll down a bit and you'll even see animated GIFs demonstrating automatic documentation creation from function definitions. It can be installed via Package Control.
I don't use Webstorm, but a quick Google search would seem to indicate that JSDoc functionality is already built-in, although it doesn't look as nifty as Sublime's, which has a bunch of config options, is more flexible, and doesn't require running a bloated IDE :)
sublime-jsdocs
is what u need.
Use this link to install it in sublime through Package Control
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With