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

Empty Lines Not Getting Commented-Out #88480

Closed
FloatingSunfish opened this issue Jan 11, 2020 · 10 comments · Fixed by #93160
Closed

Empty Lines Not Getting Commented-Out #88480

FloatingSunfish opened this issue Jan 11, 2020 · 10 comments · Fixed by #93160
Labels
editor-comments Editor commenting/uncommenting commands feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Milestone

Comments

@FloatingSunfish
Copy link

  • VSCode Version: 1.41.1
  • OS Version: Windows 10 64-bit

Steps to Reproduce:

  1. Sample code to be commented-out:
package com.mycompany.app;

public class MyApp {
    public static void main(String[] args) {
        SayHello();
    }

    static void SayHello() {
        System.out.println("Hello!");
    }
}
  1. Expected result:
// package com.mycompany.app;
// 
// public class MyApp {
//     public static void main(String[] args) {
//         SayHello();
//     }
// 
//     static void SayHello() {
//         System.out.println("Hello!");
//     }
// }
  1. Actual result:
// package com.mycompany.app;

// public class MyApp {
//     public static void main(String[] args) {
//         SayHello();
//     }

//     static void SayHello() {
//         System.out.println("Hello!");
//     }
// }

Does this issue occur when all extensions are disabled?: Yes

@connor4312
Copy link
Member

This is working as we intended it--empty lines don't get commented out.

@connor4312 connor4312 added the *as-designed Described behavior is as designed label Jan 11, 2020
@vscodebot
Copy link

vscodebot bot commented Jan 11, 2020

The described behavior is how it is expected to work. If you disagree, please explain what is expected and what is not in more detail. See also our issue reporting guidelines.

Happy Coding!

@vscodebot vscodebot bot closed this as completed Jan 11, 2020
@FloatingSunfish
Copy link
Author

FloatingSunfish commented Jan 13, 2020

@connor4312 I'm not going to request that this issue be reopened, but I would like to ask what benefits this gives developers.

When commenting-out lines of code, it helps that empty lines within your selections are commented-out to group commented sections together.

This makes it clear which lines need to be uncommented together when developers want to put them back.

Compare:

    // line 1
    // line 2
    // 
    // line 3
    // 
    // line 4

    // line 5
    // line 6
    // line 7
    // 
    // line 8
    // line 9
    // 
    // line 10

With:

    // line 1
    // line 2
    
    // line 3
     
    // line 4

    // line 5
    // line 6
    // line 7
     
    // line 8
    // line 9
     
    // line 10

EDIT:

In case this feature does get implemented, a setting can be added like "commenting.includeEmptyLines": true (with a default value of false).

This way, those who prefer to exclude empty lines from commenting will be unaffected.

@connor4312 connor4312 reopened this Jan 13, 2020
@alexdima alexdima added editor-comments Editor commenting/uncommenting commands feature-request Request for new features or functionality and removed *as-designed Described behavior is as designed labels Jan 19, 2020
@alexdima alexdima added this to the Backlog Candidates milestone Jan 19, 2020
@vscodebot
Copy link

vscodebot bot commented Jan 19, 2020

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@alexdima alexdima removed their assignment Jan 19, 2020
@vscodebot
Copy link

vscodebot bot commented Feb 14, 2020

🙂 This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@vscodebot vscodebot bot modified the milestones: Backlog Candidates, Backlog Feb 14, 2020
alvintangz added a commit to CSCD01/vscode-team19 that referenced this issue Mar 9, 2020
alvintangz added a commit to CSCD01/vscode-team19 that referenced this issue Mar 11, 2020
alvintangz added a commit to CSCD01/vscode-team19 that referenced this issue Mar 11, 2020
…st raised in microsoft#88480 with a new suite of tests based off original.
@sunsp1der
Copy link

This is causing major problems for me. Is there any way I can help make this happen?

@FloatingSunfish
Copy link
Author

@sunsp1der I think the code's been ready to merge for a while now, but I'm not sure why it hasn't yet.

@FloatingSunfish
Copy link
Author

@alvintangz, any updates on this issue? 🙂

@alvintangz
Copy link
Contributor

@FloatingSunfish you're right, it has been ready to merge for a while. All the CI tests passed and the assignee to the pull request from Microsoft hasn't looked at it.

Unfortunately, since the PR has been open for a while now, the new CI tests just failed. I'll need to fix this as soon as possible (hopefully this weekend) and then I'll mention the assignee in the pull request :shipit:

#93160

Cheers,
Team DATA - @dharm1k987, @RhymeAccel, @privatejfx141, @jzp128

@FloatingSunfish
Copy link
Author

@alvintangz Many thanks for the quick reply! We're all thankful for all your hard work!
We look forward to using your feature soon! 😄

gjsjohnmurray pushed a commit to gjsjohnmurray/vscode that referenced this issue Jul 8, 2020
gjsjohnmurray pushed a commit to gjsjohnmurray/vscode that referenced this issue Jul 8, 2020
…st raised in microsoft#88480 with a new suite of tests based off original.
gjsjohnmurray pushed a commit to gjsjohnmurray/vscode that referenced this issue Jul 9, 2020
gjsjohnmurray pushed a commit to gjsjohnmurray/vscode that referenced this issue Jul 9, 2020
…st raised in microsoft#88480 with a new suite of tests based off original.
@github-actions github-actions bot locked and limited conversation to collaborators Aug 25, 2020
@rzhao271 rzhao271 added the verified Verification succeeded label Jul 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor-comments Editor commenting/uncommenting commands feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants
@connor4312 @alexdima @alvintangz @sunsp1der @rzhao271 @FloatingSunfish and others