Description
Feature request:
Option to force CodeMaid to consider each comment line a separate comment for determining word wrap
Current
- CodeMaid assumes that comments should condensed into one line if you have several comments in the same comment block.
- CodeMaid also assumes that long comments should be broken onto newlines if possible.
Desired
If CodeMaid could be configured to not condense short comment lines, but to still break long comments into separate lines and maintain all other comment formatting options that would eliminate virtually all of the issues I have encountered with automatic comment formatting and preformatted comments.
Suggested Solution
Add a checkbox to the comment formatting options with a description like: "Consider comments on separate lines as separate comment blocks", default unchecked.
When this checkbox is not checked, CodeMaid should behave the same as it currently does.
When this checkbox is checked, CodeMaid should consider any line termination character to be the end of the comment block, thus never attempting to remove newlines in order to condense multi-line comments to one line.
At a glance through the code, it looks like this could be possibly handled by simply toggling the Regex for detecting a comment from multi-line to single-line, but that approach would need testing. My Regex is rusty so I'm not certain if the search pattern would also need to be changed.
History
I understand that CodeMaid currently allows users to control comment formatting by whether they append as space after the start of the comment to cause CodeMaid to treat it as a comment, however this method requires all comments in the solution to be set up correctly before being run through cleanup, which can be a problem for already existing code. Simply allowing us to toggle off condensing multiple short comments into one long one neatly eliminates this issue while allowing us to still benefit from the rest of the code comment formatting features.
Some historical items that deal with this theme include:
- CodeMaid treats commented out code as regular comments and makes it unusable after uncommenting #106 - fixed in Updated comment formatting logic to address some issues. #109, but it addresses some specific cases to my more general case.
- Wrap comments that don't have space after comment-symbol #423 - working as intended, but again this approach requires existing comments to have been designed with CodeMaid in mind, which can be problematic for large existing solutions or large teams.