New in 11: Javadoc editing improvements
October 20th, 2011 by Denis.ZhdanovRecently I realized that javadoc editing may be easily improved by introducing some handy little features. After using them for a couple of days, I can say they are cool, so, it’s time to share them with you. And you can try them all in the latest IntelliJ IDEA 11 EAP.
The main idea is to ease fulfilling method javadoc stubs that IntelliJ IDEA generates for you:
- Smart “End”
Pressing End when the caret is located after javadoc parameter name relocates it to the position where description should start. It respects ‘Align parameters description’ code style setting as well (‘Code Style | Javadoc | Alignment’).
Before:
After:
- Smart “Enter”
We rather often need to write a multi-line javadoc parameter description. Now pressing Enter preserves previous line indent if a corresponding option is enabled (‘Editor | Smart Keys | Enter | Smart indent’).
Before:

After:

- Smart complete statement
Corresponding support is added for smart complete statement (Ctrl+Shift+Enter by default).
Before:

After:


October 21st, 2011 at 1:00 am
Very nice. While you’re at it, could you also have a look at those?
http://youtrack.jetbrains.net/issue/IDEA-67002
http://youtrack.jetbrains.net/issue/IDEA-14591
Especially the missing images are kind of annoying
October 21st, 2011 at 3:03 am
Cool! However some other small improvements could be made, like:
- surround text with HTML elements or for example surround a Java object with {@link }
- easy insert HTML character codes, with a completion popup that triggers on ‘&’
- allow zencoding in javadoc
Anyway thanks for the continuous improvements
October 21st, 2011 at 3:09 am
Are there any feature requests for that at the tracker?
October 21st, 2011 at 4:05 am
@Denis
Yep, there is some :
- Surrounding with HTML elements : http://youtrack.jetbrains.net/issue/IDEA-69628 | http://youtrack.jetbrains.net/issue/IDEA-15296
- for the {@link } however not really exactly the same as I was porposing : http://youtrack.jetbrains.net/issue/IDEA-51889
- HTML character codes : http://youtrack.jetbrains.net/issue/IDEA-44056
And no issues about ZenCoding in the Javadoc
October 21st, 2011 at 4:21 am
@Dirk: I’m definitely going to improve javadoc support (either editing or formatting) but afraid that that will not be done to the upcoming v.11 release.
October 21st, 2011 at 5:43 am
@Brice: cool, thanks. I reassigned the tickets to me. But please note my comment to Dirk about implementation time.
October 21st, 2011 at 8:47 am
No love for Scala/ScalaDoc? http://youtrack.jetbrains.net/issue/SCL-2433
October 21st, 2011 at 9:08 am
@Denis Thanks for the attention, even if if doesn’t land right in the 11
Btw I created an issue about zencoding missing in javadoc http://youtrack.jetbrains.net/issue/IDEA-75810
October 21st, 2011 at 9:11 am
@Brice: thanks!
October 21st, 2011 at 9:33 am
@Mario
We just started progress on all scaladoc features. I hope some of them you will see soon.
October 26th, 2011 at 10:22 am
The first example, “Smart End”, should work with the tab key, I think. The tab is intuitively what key I expect to press based on the feature shown. I don’t want to remember to start typing new key presses; my brain is full as it is
October 27th, 2011 at 4:16 am
@David: that contradicts to the current approach used by IJ to tab processing, namely inserting tab/spaces