commandbox-cfformat icon indicating copy to clipboard operation
commandbox-cfformat copied to clipboard

DocBox commenting formatting

Open lmajano opened this issue 4 years ago • 6 comments

@jcberquist Java Editors have two settings which are really helpful when formatting comments.

image

  1. Ability to align parameter descriptions

This aligns the hint portions of the params. This is normal:

/**
* Startup a theme in the system, processes interceptions, modules, widgets, etc
*
* @name The name of the theme to activate
* @processWidgets Process widget registration on activation, defaults to true.
* @site The site id or object we are starting up this theme for
*/

This is the end result

/**
* Startup a theme in the system, processes interceptions, modules, widgets, etc
*
* @name                   The name of the theme to activate
* @processWidgets  Process widget registration on activation, defaults to true.
* @site                       The site id or object we are starting up this theme for
*/
  1. Align @throws descriptions
  2. Blank Lines

image

  1. Generate

    on empty lines

image

  1. Keep empty lines or not

image

lmajano avatar Dec 02 '21 22:12 lmajano

I am not sure about implementing everything here, but I did try out getting parameter descriptions and @throws descriptions aligned in v0.17.1. There is a new settings for it: alignment.doc_comments.

jcberquist avatar Dec 07 '21 02:12 jcberquist

Wow that's great!

lmajano avatar Dec 07 '21 16:12 lmajano

Is there a way to get the spacing between them also? This is really a good visual of the doc code when params are tight together, @return and @throws are together. Basically like this:

/**
 * get Java FileInputStream for resource bundle
 *
 * @rbFilePath path + filename for resource, including locale + .properties
 * @path2 Another path
 *
 * @return java.io.FileInputStream
 * 
 * @throws ResourceBundle.InvalidBundlePath
 * @throws AnotherException
 */
public function getResourceFileInputStream( required string rbFilePath, path2 ){
}

lmajano avatar Dec 07 '21 16:12 lmajano

Are you referring to the empty lines? e.g. this:

/**
 * get Java FileInputStream for resource bundle
 * @rbFilePath path + filename for resource, including locale + .properties
 * @path2 Another path
 * @return java.io.FileInputStream
 * @throws ResourceBundle.InvalidBundlePath
 * @throws AnotherException
 */
public function getResourceFileInputStream( required string rbFilePath, path2 ){
}

would become this:

/**
 * get Java FileInputStream for resource bundle
 *
 * @rbFilePath path + filename for resource, including locale + .properties
 * @path2 Another path
 *
 * @return java.io.FileInputStream
 * 
 * @throws ResourceBundle.InvalidBundlePath
 * @throws AnotherException
 */
public function getResourceFileInputStream( required string rbFilePath, path2 ){
}

jcberquist avatar Dec 07 '21 19:12 jcberquist

Yes

Luis Majano CEO Ortus Solutions, Corp 1-888-557-8057 909-248-3408 www.ortussolutions.com Support Open Source: www.patreon.com/ortussolutions Linked In: https://www.linkedin.com/pub/3/731/483 Social: twitter.com/ortussolutions | twitter.com/lmajano On Dec 7, 2021, 1:25 PM -0600, John Berquist @.***>, wrote:

Are you referring to the empty lines? e.g. this: /**

  • get Java FileInputStream for resource bundle
  • @rbFilePath path + filename for resource, including locale + .properties
  • @path2 Another path
  • @return java.io.FileInputStream
  • @throws ResourceBundle.InvalidBundlePath
  • @throws AnotherException / public function getResourceFileInputStream( required string rbFilePath, path2 ){ } would become this: /*
  • get Java FileInputStream for resource bundle
  • @rbFilePath path + filename for resource, including locale + .properties
  • @path2 Another path
  • @return java.io.FileInputStream
  • @throws ResourceBundle.InvalidBundlePath
  • @throws AnotherException */ public function getResourceFileInputStream( required string rbFilePath, path2 ){ } — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

lmajano avatar Dec 07 '21 20:12 lmajano

Alright, I have tried making this a lot more opinionated. It will now group @params and @throws together, with empty lines between the groups. It might be too opinionated now 😀 .

jcberquist avatar Dec 29 '21 22:12 jcberquist