admin管理员组文章数量:1410712
Is it possible, preferably, in Sublime Text or Webstorm, to type in a JSDoc-style ment, 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.
Is it possible, preferably, in Sublime Text or Webstorm, to type in a JSDoc-style ment, 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.
Share Improve this question edited Oct 25, 2013 at 13:12 user1228 asked Jun 18, 2013 at 17:06 pilaupilau 6,7534 gold badges59 silver badges70 bronze badges2 Answers
Reset to default 5It 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
本文标签: javascriptGenerate a function definition from a JSDoc comment (or viceversa)Stack Overflow
版权声明:本文标题:javascript - Generate a function definition from a JSDoc comment (or vice-versa) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744851668a2628529.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论