开发者

javadoc auto generation for intellij

开发者 https://www.devze.com 2023-02-03 21:08 出处:网络
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-

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)

  1. Download plugin "JavaDoc" (Ctrl + Shift + A > Plugins > Marketplace tab > search for JavaDoc (by vendor: "Sergey Timofiychuk") > Install)

and follow below steps (from Step 2).

--PREVIOUS ANSWER--

Tested below in 2018.2 version of IntelliJ

  1. Download plugin "JavaDoc2" (Ctrl + Shift + A > Plugins > Browse Repositories... > JavaDoc2)
  2. Restart IntelliJ (File > Invalid Caches/Restart... > Just Restart)
  3. 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, try Alt + Insert and selecting Create JavaDocs for the selected element
  4. Whole class: To generate for the whole class, press Ctrl + Alt + Shift + G (or Alt + Insert and selecting Create JavaDocs for all elements)

(One caveat is, it is generating javadoc only for public methods, not for fields and private methods)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号