Last updated by werdna 2 years ago
As of Grails 1.3.6, there is a convention for formatting Doc tags in Grails TagLibs. Properly formatted Docs will be interpreted by the IDE and displayed in the GSP editor. To help those who are consuming Grails plugins, it is strongly recommended that all plugin developers use the following guidelines for Doc comments in TagLibs.

Here is a description of the format:

/**
 * This is a description of the tag.  It 
 * will appear when selecting the tag in
 * hovers, content assist, etc.
 *
 * @attr myAttr This is an optional attribute 
 * and this description will appear in hovers,
 * etc.
 * 
 * @attr myAttr2 REQUIRED This is a required attribute
 * It will appear by default when this tag is selected
 * in content assist. ("REQUIRED" can be case-insensitive)
 */
def myTag = { }

With this comment in the TagLib, you get the following behavior in the GSP editor when hovering over a reference to the tag:

And similar behavior when hovering over an attribute:

Also, content assist shows all available tags, which one are required and the appropriate docs:

If you want to specify that your GSP tag is an empty tag (ie- no tag body, similar to the g:set and g:def tags), then use the @emptyTag tag, like this:

/**
 * The documentation
 *
 * @emptyTag
 *
 * @attr myAttr the attribute
 */
def myTag = { }

Currently, the Doc comment convention is only supported in STS 2.5.2 and later. Note that there is no detrimental effect if the Doc tags are not properly formatted, only that hover support is not available. For more information, see: GRAILS-6593.