How to generate javadoc comments in Android Studio

前端 未结 16 2298
野的像风
野的像风 2020-12-04 10:01

Can I use shortcut keys in Android studio to generate javadoc comments?

If not, what is the easiest way to generate javadoc comments?

相关标签:
16条回答
  • 2020-12-04 10:31

    i recommendated Dokka for geneate javadoc with comment and more

    0 讨论(0)
  • 2020-12-04 10:32

    In Android Studio you don't need the plug in. On A Mac just open Android Studio -> click Android Studio in the top bar -> click Prefrences -> find File and Code Templates in the list -> select includes -> build it and will be persistent in all your project

    0 讨论(0)
  • 2020-12-04 10:32

    Just select the Eclipse version of the keycap in the Keymap settings. An Eclipse Keymap is included in Android Studio.

    0 讨论(0)
  • 2020-12-04 10:33

    ALT+SHIFT+G will create the auto generated comments for your method (place the cursor at starting position of your method).

    0 讨论(0)
  • 2020-12-04 10:35

    To generatae comments type /** key before the method declaration and press Enter. It will generage javadoc comment.

    Example:

    /**
    * @param a
    * @param b
    */
    
    public void add(int a, int b) {
        //code here
    }
    

    For more information check the link https://www.jetbrains.com/idea/features/javadoc.html

    0 讨论(0)
  • 2020-12-04 10:36

    In Android studio we have few ways to auto-generated comments:

    • Method I:

    By typing /** and Then pressing Enter you can generate next comment line and it will auto-generate the params, etc. but when you need the hotkey for this check out method II on below.

    • **Method II: **

    1 - Goto topMenu

    2 - File > Settings

    3 - Select Keymap from settings

    4 - On the top right search bar search for "Fix Doc"

    5 - Select the "fix doc comment" from the results and double-click on it

    6 - Select Add keyboard shortcut from the opened drop down after double-click

    7 - Press the shortcut keys on the keyboard

    8 - Goto your code and where you want to add some comment press the shortcut key

    9 - Enjoy!

    0 讨论(0)
提交回复
热议问题