2

I started Android studio (2.1.2) today and when trying to add block comments using /** + enter, it is not generating the entire block with params and return statement.

I'm not sure what is causing this.

I tried googling the issue. But I'm unable to fix as of now with the solutions out there.

Please help me out to fix this issue.

2
  • Does this help? Commented Jun 29, 2016 at 0:31
  • It's working now without any fix .. Weird .. Bloody studio .. don't know why.. Sorry guys.. Thanks @Sufian for ur response.. Commented Jun 29, 2016 at 0:53

1 Answer 1

2

It's a Bug in Android studio.

If it is the last method in the class and you have some commented block comments below it, then you can't generate block comments.

Some thing like this:

{
  ......

    // You can't do a /** + enter here;
    // it won't generate JavaDoc if you do.
    public ViewPager getViewPager() {
        return mViewPager;
    }

    //  /*
    //   * Inner classes, interfaces, enums
    //   */
}

In this case, IDE doesn't generate block comment for getViewPager().

Sign up to request clarification or add additional context in comments.

9 Comments

The /** autogenerate works only on top of Class Constructors and Methods. And adding // to /***/ seems kinda redundant. I would prefer to use only /***/ if my comment is as long as paragraph, if it is single line I'll just use //.
Sorry, My explanation might have confused you. But if there is already a commented block comment at the end of class for some reason, then the auto block comment generation doesn't work for last method in the class.
Why you are adding // on /**? And basically /** has no effect when your methods has no arguments.
I'm not adding // as well, I just commented there for explaining. :)
Ah I see. Since your getViewPager() has no arguments at all, the /** will only provide @return ViewPager :) .
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.