javadoc auto generation for intellij
Is there an automatic Javadoc generation plugin for IntelliJ? Exampl开发者_StackOverflowe http://jautodoc.sourceforge.net/
Javadoc generation (writing the .html files) is done for you on-demand (Tools->Generate Javadoc) and is essentially automatic once you set it up. Generating javadoc stubs, which is what jautodoc for Eclipse does, is done method-by-method, class-by-class and only where you tell it to.
Typing /** <enter>
above a method signature will create Javadoc stubs for you. I suspect you want something that will do this for an entire file, package or project though (like jautodoc). There used to be such a plugin: http://plugins.intellij.net/plugin/?id=952 but it won't work with 10.
I do have to say that this jautodoc example, while a neat party trick, is the single most useless thing I've ever seen in an IDE: It creates a description based on the variable name - but only if the variable name is so descriptive that it doesn't need a comment in the first place.
/**
* The number of questions
*/
private int numberOfQuestions;
Makes you yearn for punched card.
Updated the answer for 2020.3
version of IntelliJ (also works in 2019.2
)
- Download plugin "JavaDoc" (
Ctrl
+Shift
+A
>Plugins
>Marketplace
tab > search forJavaDoc
(by vendor: "Sergey Timofiychuk") > Install)
and follow below steps (from Step 2).
--PREVIOUS ANSWER--
Tested below in 2018.2
version of IntelliJ
- Download plugin "JavaDoc2" (
Ctrl
+Shift
+A
>Plugins
>Browse Repositories...
>JavaDoc2
) - Restart IntelliJ (
File
>Invalid Caches/Restart...
>Just Restart
) - For current element: To generate Javadoc for current element (say a setter method), press
Alt
+Shift
+G
. If this doesn't work due to different keymap association, tryAlt
+Insert
and selectingCreate JavaDocs for the selected element
- Whole class: To generate for the whole class, press
Ctrl
+Alt
+Shift
+G
(orAlt
+Insert
and selectingCreate JavaDocs for all elements
)
(One caveat is, it is generating javadoc only for public methods, not for fields and private methods)
精彩评论