Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sublime text auto Java doc comment

How do I get Sublime Text to automatically generating Javadoc comments for methods? I tried looking around but amounted to nothing.

like image 688
George Newton Avatar asked Apr 12 '14 03:04

George Newton


People also ask

How do you add Javadoc comments in Java?

Adding JavaDoc comments The basic rule for creating JavaDoc comments is that they begin with /** and end with */. You can place JavaDoc comments in any of three different locations in a source file: Immediately before the declaration of a public class. Immediately before the declaration of a public field.

How do I create an automatic Javadoc?

In the Package Explorer view, select a Java project and click Project > Generate Javadoc with Diagrams > Automatically. In the Generate Javadoc wizard, under Javadoc command, select the Javadoc command (an executable file). Note: Only Oracle JDK Version 1.4.

How do you write a comment document in Java?

A doc comment is written in HTML and must precede a class, field, constructor or method declaration. It is made up of two parts -- a description followed by block tags. In this example, the block tags are @param , @return , and @see .

How do I generate comments in Eclipse?

Step 1 − Open eclipse, select the option Project →Generate Javadoc. Step 2 − Select the javadoc.exe file from the bin folder of java installation directory, select the destination folder for the generated java doc and select Next. finish button.


1 Answers

You might want to try DocBlockr.

It recognizes method parameters correctly and it lets you conveniently tab through the fields (like you do it when using Sublime snippets). But it is not flawless; it seems to have trouble with functions that return arrays, and it adds an @param block for constructors, too.

I guess it depends on how much automation you want.

(Type /** and press enter to trigger it. The gitHub readme has more details on how to use it)

like image 195
25A0 Avatar answered Sep 22 '22 01:09

25A0