Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DocBox commenting formatting #134

Open
lmajano opened this issue Dec 2, 2021 · 6 comments
Open

DocBox commenting formatting #134

lmajano opened this issue Dec 2, 2021 · 6 comments

Comments

@lmajano
Copy link

lmajano commented Dec 2, 2021

@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

jcberquist added a commit that referenced this issue Dec 7, 2021
@jcberquist
Copy link
Owner

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.

@lmajano
Copy link
Author

lmajano commented Dec 7, 2021

Wow that's great!

@lmajano
Copy link
Author

lmajano commented Dec 7, 2021

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 ){
}

@jcberquist
Copy link
Owner

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 ){
}

@lmajano
Copy link
Author

lmajano commented Dec 7, 2021 via email

@jcberquist
Copy link
Owner

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 😀 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants