How to generate jsDoc stubs in .js files?

I'm trying to generate jsDoc documentation stubs in .js files.  The Help site says jsDoc is supported and links to the JavaDoc instructions (ie. type *// and hit 'Enter'), which work for me in .java files, but I can't get the same auto stub generation to work in .js files.  I just type /** and hit 'Enter' and nothing happens.  Is there a setting that I'm missing to activate this?   Do I need an additional plugin?

Thanks for any help!

0
7 comments
Avatar
Permanently deleted user

Anyone know if this is possible?


0
Avatar
Maxim Mossienko

Yes, it should work if there is text after the doc (at least one newline).

0
Avatar
Permanently deleted user

What do you mean 'text after the doc' ?  Can you give me an example of how it works?

In a .java file I type /** then hit 'Enter' and it generates this automatically:

    /**
     *
     */

But not sure how to do the same in .js files....

0
Avatar
Permanently deleted user

Here is an example but it didn't work for me:
https://www.jetbrains.com/help/idea/creating-jsdoc-comments.html#d102825e71

Hope it helps.

0

Works fine for me - hitting Enter after /** in

/**
function loadDocs(myParam1, myParam2){}

correctly generates

/**
*
* @param myParam1
* @param myParam2
*/
function loadDocs(myParam1, myParam2){}

Please provide exact code snippet/steps you have tried

 

0
Avatar
Permanently deleted user

I try with the same combination Elena. In my case, it generates the jsdocs without @param or return.

0

can you repeat it in an empty file? Create a new .js file, add a method, try generating JSdoc stubs - what is the result?

0

Please sign in to leave a comment.