Skip to content

Feature #88480: Empty Lines Not Getting Commented-Out#93160

Merged
alexdima merged 6 commits intomicrosoft:masterfrom
CSCD01:team19/comment-whitespace-88480
Jul 7, 2020
Merged

Feature #88480: Empty Lines Not Getting Commented-Out#93160
alexdima merged 6 commits intomicrosoft:masterfrom
CSCD01:team19/comment-whitespace-88480

Conversation

@alvintangz
Copy link
Contributor

This PR fixes #88480

New setting editor.comments.includeEmptyLines allows you to include empty lines when adding or toggling single-line comments. Default behaviour does not allow for that to happen.

Acceptance test:

  1. Open up a file that supports single-line comments (e.g. JS File)
  2. Select a group of lines with empty lines in between
  3. Toggle single-line comments (editor.action.toggleCommentLine) or add new single-line comments (editor.action.addCommentLine)
  4. Enable setting via settings.json or in the UI
  5. Toggle or add new single-line comments again to see the difference

Tests provided.

Feel free to give suggestions. Cheers

@msftclas
Copy link

msftclas commented Mar 22, 2020

CLA assistant check
All CLA requirements met.

@n4nn31355
Copy link

Are there any chances to be merged? It's a big pain, especially for those who use prettier for auto formatting that removes blank lines between comments.

@alvintangz
Copy link
Contributor Author

@n4nn31355 new CI tests failed. Going to fix it asap and then mention the assignee in the PR to get it pushed.

@alexdima alexdima self-requested a review July 7, 2020 06:53
@alexdima alexdima merged commit 20abb1a into microsoft:master Jul 7, 2020
@alexdima alexdima added this to the July 2020 milestone Jul 7, 2020
@alexdima
Copy link
Member

alexdima commented Jul 7, 2020

Thank you!

@FloatingSunfish
Copy link

@alvintangz Many thanks to you and the VS Code team for implementing this much-requested feature!
We look forward to seeing it in a future update! Cheers!

@github-actions github-actions bot locked and limited conversation to collaborators Aug 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Empty Lines Not Getting Commented-Out

7 participants