Reformats your multiline comments into beautiful, maximum 80 character long lines, with no gaps or irregularities. ✨
What?
Turns this:
Into this:
Why?
It's easy to format your comments correctly while writing them. But if you edit them later, it's annoying to reformat them.
How?
- Install format-javascript-comment (either through the package manager or through
apm install format-javascript-comment
). - (Partially) select the lines the comment encompasses.
- Open command pallette (Cmd+Shift+P) and (partially) type "format comment".
- Press enter.
Features
- Single line comments (
// Whatever
) - Multiline comments (
* Whatever
) - JSDoc tags always start on a new line (
* @param {string} name Some description.
)
TODO
- Better way to find the selection automatically if no selection is provided
- Distribute words consistently across lines
- Configurable line length