Uncomment multiline code in eclipse2019 Community Moderator ElectionEclipse comment/uncomment shortcut?Cannot remove block comment in Eclipse after formattingEclipse: Can you format code on save?How can you speed up Eclipse?'Must Override a Superclass Method' Errors after importing a project into Eclipse“Debug certificate expired” error in Eclipse Android pluginsEclipse: Set maximum line length for auto formatting?Eclipse comment/uncomment shortcut?Can't start Eclipse - Java was started but returned exit code=13Eclipse ctrl+right does nothingEclipse (ctrl+shift+f) does nothingUncomment java code in eclipse shortcut

Algorithm to convert a fixed-length string to the smallest possible collision-free representation?

How do I express some one as a black person?

How do I locate a classical quotation?

Can you reject a postdoc offer after the PI has paid a large sum for flights/accommodation for your visit?

A three room house but a three headED dog

Examples of a statistic that is not independent of sample's distribution?

Unreachable code, but reachable with exception

Am I not good enough for you?

"One can do his homework in the library"

Should I take out a loan for a friend to invest on my behalf?

How to pass a string to a command that expects a file?

PTIJ: How can I halachically kill a vampire?

Finding algorithms of QGIS commands?

What is the likely impact of grounding an entire aircraft series?

What is the chance of making a successful appeal to dismissal decision from a PhD program after failing the qualifying exam in the 2nd attempt?

Could a cubesat be propelled to the moon?

Is it true that real estate prices mainly go up?

Replacing Windows 7 security updates with anti-virus?

Do items de-spawn in Diablo?

The bar has been raised

How much stiffer are 23c tires over 28c?

Why doesn't this Google Translate ad use the word "Translation" instead of "Translate"?

What are some noteworthy "mic-drop" moments in math?

How to create a hard link to an inode (ext4)?



Uncomment multiline code in eclipse



2019 Community Moderator ElectionEclipse comment/uncomment shortcut?Cannot remove block comment in Eclipse after formattingEclipse: Can you format code on save?How can you speed up Eclipse?'Must Override a Superclass Method' Errors after importing a project into Eclipse“Debug certificate expired” error in Eclipse Android pluginsEclipse: Set maximum line length for auto formatting?Eclipse comment/uncomment shortcut?Can't start Eclipse - Java was started but returned exit code=13Eclipse ctrl+right does nothingEclipse (ctrl+shift+f) does nothingUncomment java code in eclipse shortcut










10















Yes, this could be duplicate of Eclipse comment/uncomment shortcut? But, answers given their are not working for my case.



I have formatted java code and When I select and use ctrl + shift + / it looks like



/*
* if (isKilled) Log.i("TAG", "Killed");
*/


But when I use ctrl + shift + / for above selected code, eclipse is not un-commenting my code.



I tried ctrl + shift + , ctrl + shift + / and ctrl + . Nothing worked. I always manually remove *s even if commented code is very big.



How to do this? I also want *s to be removed.










share|improve this question
























  • possible duplicate of Eclipse comment/uncomment shortcut?

    – 1ac0
    Feb 12 '14 at 10:02






  • 1





    Afaik there is a tendency to move away from /**/ comments in favor of // ones. The // comments are easily toggled for multiple lines by Ctrl + Shift + C. I guess that this simplicity of IDE support is the reason why many developers prefer // over /**/.

    – noncom
    Feb 12 '14 at 10:16












  • Yes // could be easy. But is their a way for /***/ ?

    – Sundeep1501
    Feb 12 '14 at 10:38











  • As of date in 2017 there is no solution for this !

    – Sankalp
    Apr 4 '17 at 11:00











  • This is so far the best solution I found stackoverflow.com/a/34553134/1053496.

    – nantitv
    Jun 20 '17 at 14:47
















10















Yes, this could be duplicate of Eclipse comment/uncomment shortcut? But, answers given their are not working for my case.



I have formatted java code and When I select and use ctrl + shift + / it looks like



/*
* if (isKilled) Log.i("TAG", "Killed");
*/


But when I use ctrl + shift + / for above selected code, eclipse is not un-commenting my code.



I tried ctrl + shift + , ctrl + shift + / and ctrl + . Nothing worked. I always manually remove *s even if commented code is very big.



How to do this? I also want *s to be removed.










share|improve this question
























  • possible duplicate of Eclipse comment/uncomment shortcut?

    – 1ac0
    Feb 12 '14 at 10:02






  • 1





    Afaik there is a tendency to move away from /**/ comments in favor of // ones. The // comments are easily toggled for multiple lines by Ctrl + Shift + C. I guess that this simplicity of IDE support is the reason why many developers prefer // over /**/.

    – noncom
    Feb 12 '14 at 10:16












  • Yes // could be easy. But is their a way for /***/ ?

    – Sundeep1501
    Feb 12 '14 at 10:38











  • As of date in 2017 there is no solution for this !

    – Sankalp
    Apr 4 '17 at 11:00











  • This is so far the best solution I found stackoverflow.com/a/34553134/1053496.

    – nantitv
    Jun 20 '17 at 14:47














10












10








10


1






Yes, this could be duplicate of Eclipse comment/uncomment shortcut? But, answers given their are not working for my case.



I have formatted java code and When I select and use ctrl + shift + / it looks like



/*
* if (isKilled) Log.i("TAG", "Killed");
*/


But when I use ctrl + shift + / for above selected code, eclipse is not un-commenting my code.



I tried ctrl + shift + , ctrl + shift + / and ctrl + . Nothing worked. I always manually remove *s even if commented code is very big.



How to do this? I also want *s to be removed.










share|improve this question
















Yes, this could be duplicate of Eclipse comment/uncomment shortcut? But, answers given their are not working for my case.



I have formatted java code and When I select and use ctrl + shift + / it looks like



/*
* if (isKilled) Log.i("TAG", "Killed");
*/


But when I use ctrl + shift + / for above selected code, eclipse is not un-commenting my code.



I tried ctrl + shift + , ctrl + shift + / and ctrl + . Nothing worked. I always manually remove *s even if commented code is very big.



How to do this? I also want *s to be removed.







eclipse






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 23 '17 at 12:10









Community

11




11










asked Feb 12 '14 at 9:58









Sundeep1501Sundeep1501

99411125




99411125












  • possible duplicate of Eclipse comment/uncomment shortcut?

    – 1ac0
    Feb 12 '14 at 10:02






  • 1





    Afaik there is a tendency to move away from /**/ comments in favor of // ones. The // comments are easily toggled for multiple lines by Ctrl + Shift + C. I guess that this simplicity of IDE support is the reason why many developers prefer // over /**/.

    – noncom
    Feb 12 '14 at 10:16












  • Yes // could be easy. But is their a way for /***/ ?

    – Sundeep1501
    Feb 12 '14 at 10:38











  • As of date in 2017 there is no solution for this !

    – Sankalp
    Apr 4 '17 at 11:00











  • This is so far the best solution I found stackoverflow.com/a/34553134/1053496.

    – nantitv
    Jun 20 '17 at 14:47


















  • possible duplicate of Eclipse comment/uncomment shortcut?

    – 1ac0
    Feb 12 '14 at 10:02






  • 1





    Afaik there is a tendency to move away from /**/ comments in favor of // ones. The // comments are easily toggled for multiple lines by Ctrl + Shift + C. I guess that this simplicity of IDE support is the reason why many developers prefer // over /**/.

    – noncom
    Feb 12 '14 at 10:16












  • Yes // could be easy. But is their a way for /***/ ?

    – Sundeep1501
    Feb 12 '14 at 10:38











  • As of date in 2017 there is no solution for this !

    – Sankalp
    Apr 4 '17 at 11:00











  • This is so far the best solution I found stackoverflow.com/a/34553134/1053496.

    – nantitv
    Jun 20 '17 at 14:47

















possible duplicate of Eclipse comment/uncomment shortcut?

– 1ac0
Feb 12 '14 at 10:02





possible duplicate of Eclipse comment/uncomment shortcut?

– 1ac0
Feb 12 '14 at 10:02




1




1





Afaik there is a tendency to move away from /**/ comments in favor of // ones. The // comments are easily toggled for multiple lines by Ctrl + Shift + C. I guess that this simplicity of IDE support is the reason why many developers prefer // over /**/.

– noncom
Feb 12 '14 at 10:16






Afaik there is a tendency to move away from /**/ comments in favor of // ones. The // comments are easily toggled for multiple lines by Ctrl + Shift + C. I guess that this simplicity of IDE support is the reason why many developers prefer // over /**/.

– noncom
Feb 12 '14 at 10:16














Yes // could be easy. But is their a way for /***/ ?

– Sundeep1501
Feb 12 '14 at 10:38





Yes // could be easy. But is their a way for /***/ ?

– Sundeep1501
Feb 12 '14 at 10:38













As of date in 2017 there is no solution for this !

– Sankalp
Apr 4 '17 at 11:00





As of date in 2017 there is no solution for this !

– Sankalp
Apr 4 '17 at 11:00













This is so far the best solution I found stackoverflow.com/a/34553134/1053496.

– nantitv
Jun 20 '17 at 14:47






This is so far the best solution I found stackoverflow.com/a/34553134/1053496.

– nantitv
Jun 20 '17 at 14:47













8 Answers
8






active

oldest

votes


















8














Try using Ctr+Shift+C
This should work






share|improve this answer


















  • 3





    its not working

    – Sundeep1501
    Feb 12 '14 at 10:10











  • Check your key map. go to tools ->options then select key map tab. type "comment" in the search bar

    – Pratik Roy
    Feb 12 '14 at 10:15











  • It says toggle comment - java source code. I have tried but not working for *ed multiline code

    – Sundeep1501
    Feb 12 '14 at 10:51











  • Does not work with multiline code when comments have different level (// //// etc.)

    – Sonique
    Apr 15 '15 at 14:42











  • This works for only single line code blocks (//)

    – dshgna
    Apr 23 '15 at 10:31


















7














For me Remove Block Comment (Ctrl + Shift + ) works but only if there is code on the first line of the comment, so your example does not work but:



/* if (isKilled) Log.i("TAG", "Killed"); 
*/


does work.






share|improve this answer























  • True, But I am looking for multiline

    – Sundeep1501
    Feb 12 '14 at 10:40






  • 1





    This is multiline, you have to have code on the first line of the comment.

    – greg-449
    Feb 12 '14 at 10:55






  • 1





    I tried with code on first line. Its removing /* and */ but not removing *s from second line

    – Sundeep1501
    Feb 12 '14 at 11:58












  • Yes, it only works with comments exactly as inserted by Add Block Comment - which does not add * on intermediate lines.

    – greg-449
    Feb 12 '14 at 12:15






  • 1





    if we format the code which is commented using /* */, eclipse editor adds * for intermediate lines too.

    – Sundeep1501
    Feb 12 '14 at 13:10


















1














I am having this problem since ever. Always had in mind that Ctrl + Shift + C would away be the right way to comment but it never "uncomment".



Instead just change for to use Ctrl + / (for groups also) , or Ctrl + Shift + / for /**/ if you prefer.



It never fails, do not stress yourself again.






share|improve this answer






























    1














    One partial solution to this is to disable block comment formatting.



    If you do that, Eclipse will not add * for intermediate lines in multiline block comments when you format the code. And so you will be able to remove such block comments with Ctrl+Shift+ or just by removing /* and */



    In Eclipse for PHP (Windows), in the main menu Window->Preferences->PHP->CodeStyle->Formatter->Edit->Comments
    Uncheck "Enable block comment formatting"






    share|improve this answer
































      0














      It is basically a case when save actions is enabled in eclipse. When you put block comments using "Crtl + Shift + /" or by typing yourself as:



      /*
      line 1
      line 2
      line 3
      */


      and save it, the editor formats it to



       /*
      * line 1
      * line 2
      * line 3
      */


      * are added on each intermediate lines. This results "Crtl + Shift + " to fail to remove those "*" before the lines.



      The solution is:



      1- Use "Crtl + Shift + C" to comment and uncomment (toggle). Preferable one.



      2- If you don't want to use "Crtl + Shift + C". This is a hack actually. When you save, the editor formats the code like:



       /*
      * line 1
      * line 2
      * line 3
      */


      You intermediately undo (Crtl + Z) it. The editor will put it back to earlier stage but code is saved like:



      /*
      line 1
      line 2
      line 3
      */


      Now you can use "Crtl + Shift + " to uncomment when needed. The * won't trouble you :)






      share|improve this answer






























        0














        This might not be as easy. But still it works!
        I use Ctrl+F to get the Find and Replace window, check the Regular expressions check box and use this regex ^(s*)/?*/?(.*)$ and 12 in the replace part and click "Replace All".
        If you want to uncomment only one commented code part, you can select that area and use the radio button "Selected lines" in the scope part.



        Regex break up

        ^ #denotes start of the line. To avoid matching * in other part of the code.
        ( #first group. To preserve the indentation
        s* #selects the tab/space. The indentation
        ) #first group is closed
        /? matches the forward slash in the first line of comment
        * matches the star(Asterik) in the comments. backward slash is used as a delimiter
        /? matches the forward slash in the last line of comment
        ( #second group. To preserve the indentation
        .* # the actual code to be uncommented
        ) #second group is closed
        $ # till the end of the line



        Hope this helps!






        share|improve this answer






























          0














          1. Select the lines of code u wanna comment/uncomment.


          2. Then hit "Ctrl + / " to comment/uncomment.






          share|improve this answer






























            0














            In Eclipse,
            To add and remove single line comments,



            CNTRL+SHIFT+C



            Example:



            // if(i==1)
            // ...
            //


            To add and remove multi line comments,



            CNTRL+SHIFT+/ --> add
            CNTRL+SHIFT+ --> remove



            Example:



            /* if(i==1)
            ...

            */





            share|improve this answer








            New contributor




            harsha is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.



















              Your Answer






              StackExchange.ifUsing("editor", function ()
              StackExchange.using("externalEditor", function ()
              StackExchange.using("snippets", function ()
              StackExchange.snippets.init();
              );
              );
              , "code-snippets");

              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "1"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f21724456%2funcomment-multiline-code-in-eclipse%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              8 Answers
              8






              active

              oldest

              votes








              8 Answers
              8






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              8














              Try using Ctr+Shift+C
              This should work






              share|improve this answer


















              • 3





                its not working

                – Sundeep1501
                Feb 12 '14 at 10:10











              • Check your key map. go to tools ->options then select key map tab. type "comment" in the search bar

                – Pratik Roy
                Feb 12 '14 at 10:15











              • It says toggle comment - java source code. I have tried but not working for *ed multiline code

                – Sundeep1501
                Feb 12 '14 at 10:51











              • Does not work with multiline code when comments have different level (// //// etc.)

                – Sonique
                Apr 15 '15 at 14:42











              • This works for only single line code blocks (//)

                – dshgna
                Apr 23 '15 at 10:31















              8














              Try using Ctr+Shift+C
              This should work






              share|improve this answer


















              • 3





                its not working

                – Sundeep1501
                Feb 12 '14 at 10:10











              • Check your key map. go to tools ->options then select key map tab. type "comment" in the search bar

                – Pratik Roy
                Feb 12 '14 at 10:15











              • It says toggle comment - java source code. I have tried but not working for *ed multiline code

                – Sundeep1501
                Feb 12 '14 at 10:51











              • Does not work with multiline code when comments have different level (// //// etc.)

                – Sonique
                Apr 15 '15 at 14:42











              • This works for only single line code blocks (//)

                – dshgna
                Apr 23 '15 at 10:31













              8












              8








              8







              Try using Ctr+Shift+C
              This should work






              share|improve this answer













              Try using Ctr+Shift+C
              This should work







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Feb 12 '14 at 10:08









              Pratik RoyPratik Roy

              518415




              518415







              • 3





                its not working

                – Sundeep1501
                Feb 12 '14 at 10:10











              • Check your key map. go to tools ->options then select key map tab. type "comment" in the search bar

                – Pratik Roy
                Feb 12 '14 at 10:15











              • It says toggle comment - java source code. I have tried but not working for *ed multiline code

                – Sundeep1501
                Feb 12 '14 at 10:51











              • Does not work with multiline code when comments have different level (// //// etc.)

                – Sonique
                Apr 15 '15 at 14:42











              • This works for only single line code blocks (//)

                – dshgna
                Apr 23 '15 at 10:31












              • 3





                its not working

                – Sundeep1501
                Feb 12 '14 at 10:10











              • Check your key map. go to tools ->options then select key map tab. type "comment" in the search bar

                – Pratik Roy
                Feb 12 '14 at 10:15











              • It says toggle comment - java source code. I have tried but not working for *ed multiline code

                – Sundeep1501
                Feb 12 '14 at 10:51











              • Does not work with multiline code when comments have different level (// //// etc.)

                – Sonique
                Apr 15 '15 at 14:42











              • This works for only single line code blocks (//)

                – dshgna
                Apr 23 '15 at 10:31







              3




              3





              its not working

              – Sundeep1501
              Feb 12 '14 at 10:10





              its not working

              – Sundeep1501
              Feb 12 '14 at 10:10













              Check your key map. go to tools ->options then select key map tab. type "comment" in the search bar

              – Pratik Roy
              Feb 12 '14 at 10:15





              Check your key map. go to tools ->options then select key map tab. type "comment" in the search bar

              – Pratik Roy
              Feb 12 '14 at 10:15













              It says toggle comment - java source code. I have tried but not working for *ed multiline code

              – Sundeep1501
              Feb 12 '14 at 10:51





              It says toggle comment - java source code. I have tried but not working for *ed multiline code

              – Sundeep1501
              Feb 12 '14 at 10:51













              Does not work with multiline code when comments have different level (// //// etc.)

              – Sonique
              Apr 15 '15 at 14:42





              Does not work with multiline code when comments have different level (// //// etc.)

              – Sonique
              Apr 15 '15 at 14:42













              This works for only single line code blocks (//)

              – dshgna
              Apr 23 '15 at 10:31





              This works for only single line code blocks (//)

              – dshgna
              Apr 23 '15 at 10:31













              7














              For me Remove Block Comment (Ctrl + Shift + ) works but only if there is code on the first line of the comment, so your example does not work but:



              /* if (isKilled) Log.i("TAG", "Killed"); 
              */


              does work.






              share|improve this answer























              • True, But I am looking for multiline

                – Sundeep1501
                Feb 12 '14 at 10:40






              • 1





                This is multiline, you have to have code on the first line of the comment.

                – greg-449
                Feb 12 '14 at 10:55






              • 1





                I tried with code on first line. Its removing /* and */ but not removing *s from second line

                – Sundeep1501
                Feb 12 '14 at 11:58












              • Yes, it only works with comments exactly as inserted by Add Block Comment - which does not add * on intermediate lines.

                – greg-449
                Feb 12 '14 at 12:15






              • 1





                if we format the code which is commented using /* */, eclipse editor adds * for intermediate lines too.

                – Sundeep1501
                Feb 12 '14 at 13:10















              7














              For me Remove Block Comment (Ctrl + Shift + ) works but only if there is code on the first line of the comment, so your example does not work but:



              /* if (isKilled) Log.i("TAG", "Killed"); 
              */


              does work.






              share|improve this answer























              • True, But I am looking for multiline

                – Sundeep1501
                Feb 12 '14 at 10:40






              • 1





                This is multiline, you have to have code on the first line of the comment.

                – greg-449
                Feb 12 '14 at 10:55






              • 1





                I tried with code on first line. Its removing /* and */ but not removing *s from second line

                – Sundeep1501
                Feb 12 '14 at 11:58












              • Yes, it only works with comments exactly as inserted by Add Block Comment - which does not add * on intermediate lines.

                – greg-449
                Feb 12 '14 at 12:15






              • 1





                if we format the code which is commented using /* */, eclipse editor adds * for intermediate lines too.

                – Sundeep1501
                Feb 12 '14 at 13:10













              7












              7








              7







              For me Remove Block Comment (Ctrl + Shift + ) works but only if there is code on the first line of the comment, so your example does not work but:



              /* if (isKilled) Log.i("TAG", "Killed"); 
              */


              does work.






              share|improve this answer













              For me Remove Block Comment (Ctrl + Shift + ) works but only if there is code on the first line of the comment, so your example does not work but:



              /* if (isKilled) Log.i("TAG", "Killed"); 
              */


              does work.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Feb 12 '14 at 10:13









              greg-449greg-449

              90k1663100




              90k1663100












              • True, But I am looking for multiline

                – Sundeep1501
                Feb 12 '14 at 10:40






              • 1





                This is multiline, you have to have code on the first line of the comment.

                – greg-449
                Feb 12 '14 at 10:55






              • 1





                I tried with code on first line. Its removing /* and */ but not removing *s from second line

                – Sundeep1501
                Feb 12 '14 at 11:58












              • Yes, it only works with comments exactly as inserted by Add Block Comment - which does not add * on intermediate lines.

                – greg-449
                Feb 12 '14 at 12:15






              • 1





                if we format the code which is commented using /* */, eclipse editor adds * for intermediate lines too.

                – Sundeep1501
                Feb 12 '14 at 13:10

















              • True, But I am looking for multiline

                – Sundeep1501
                Feb 12 '14 at 10:40






              • 1





                This is multiline, you have to have code on the first line of the comment.

                – greg-449
                Feb 12 '14 at 10:55






              • 1





                I tried with code on first line. Its removing /* and */ but not removing *s from second line

                – Sundeep1501
                Feb 12 '14 at 11:58












              • Yes, it only works with comments exactly as inserted by Add Block Comment - which does not add * on intermediate lines.

                – greg-449
                Feb 12 '14 at 12:15






              • 1





                if we format the code which is commented using /* */, eclipse editor adds * for intermediate lines too.

                – Sundeep1501
                Feb 12 '14 at 13:10
















              True, But I am looking for multiline

              – Sundeep1501
              Feb 12 '14 at 10:40





              True, But I am looking for multiline

              – Sundeep1501
              Feb 12 '14 at 10:40




              1




              1





              This is multiline, you have to have code on the first line of the comment.

              – greg-449
              Feb 12 '14 at 10:55





              This is multiline, you have to have code on the first line of the comment.

              – greg-449
              Feb 12 '14 at 10:55




              1




              1





              I tried with code on first line. Its removing /* and */ but not removing *s from second line

              – Sundeep1501
              Feb 12 '14 at 11:58






              I tried with code on first line. Its removing /* and */ but not removing *s from second line

              – Sundeep1501
              Feb 12 '14 at 11:58














              Yes, it only works with comments exactly as inserted by Add Block Comment - which does not add * on intermediate lines.

              – greg-449
              Feb 12 '14 at 12:15





              Yes, it only works with comments exactly as inserted by Add Block Comment - which does not add * on intermediate lines.

              – greg-449
              Feb 12 '14 at 12:15




              1




              1





              if we format the code which is commented using /* */, eclipse editor adds * for intermediate lines too.

              – Sundeep1501
              Feb 12 '14 at 13:10





              if we format the code which is commented using /* */, eclipse editor adds * for intermediate lines too.

              – Sundeep1501
              Feb 12 '14 at 13:10











              1














              I am having this problem since ever. Always had in mind that Ctrl + Shift + C would away be the right way to comment but it never "uncomment".



              Instead just change for to use Ctrl + / (for groups also) , or Ctrl + Shift + / for /**/ if you prefer.



              It never fails, do not stress yourself again.






              share|improve this answer



























                1














                I am having this problem since ever. Always had in mind that Ctrl + Shift + C would away be the right way to comment but it never "uncomment".



                Instead just change for to use Ctrl + / (for groups also) , or Ctrl + Shift + / for /**/ if you prefer.



                It never fails, do not stress yourself again.






                share|improve this answer

























                  1












                  1








                  1







                  I am having this problem since ever. Always had in mind that Ctrl + Shift + C would away be the right way to comment but it never "uncomment".



                  Instead just change for to use Ctrl + / (for groups also) , or Ctrl + Shift + / for /**/ if you prefer.



                  It never fails, do not stress yourself again.






                  share|improve this answer













                  I am having this problem since ever. Always had in mind that Ctrl + Shift + C would away be the right way to comment but it never "uncomment".



                  Instead just change for to use Ctrl + / (for groups also) , or Ctrl + Shift + / for /**/ if you prefer.



                  It never fails, do not stress yourself again.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Mar 17 '16 at 17:09









                  maihemaihe

                  337




                  337





















                      1














                      One partial solution to this is to disable block comment formatting.



                      If you do that, Eclipse will not add * for intermediate lines in multiline block comments when you format the code. And so you will be able to remove such block comments with Ctrl+Shift+ or just by removing /* and */



                      In Eclipse for PHP (Windows), in the main menu Window->Preferences->PHP->CodeStyle->Formatter->Edit->Comments
                      Uncheck "Enable block comment formatting"






                      share|improve this answer





























                        1














                        One partial solution to this is to disable block comment formatting.



                        If you do that, Eclipse will not add * for intermediate lines in multiline block comments when you format the code. And so you will be able to remove such block comments with Ctrl+Shift+ or just by removing /* and */



                        In Eclipse for PHP (Windows), in the main menu Window->Preferences->PHP->CodeStyle->Formatter->Edit->Comments
                        Uncheck "Enable block comment formatting"






                        share|improve this answer



























                          1












                          1








                          1







                          One partial solution to this is to disable block comment formatting.



                          If you do that, Eclipse will not add * for intermediate lines in multiline block comments when you format the code. And so you will be able to remove such block comments with Ctrl+Shift+ or just by removing /* and */



                          In Eclipse for PHP (Windows), in the main menu Window->Preferences->PHP->CodeStyle->Formatter->Edit->Comments
                          Uncheck "Enable block comment formatting"






                          share|improve this answer















                          One partial solution to this is to disable block comment formatting.



                          If you do that, Eclipse will not add * for intermediate lines in multiline block comments when you format the code. And so you will be able to remove such block comments with Ctrl+Shift+ or just by removing /* and */



                          In Eclipse for PHP (Windows), in the main menu Window->Preferences->PHP->CodeStyle->Formatter->Edit->Comments
                          Uncheck "Enable block comment formatting"







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Aug 24 '18 at 10:49

























                          answered Apr 11 '17 at 13:15









                          CITBLCITBL

                          71321229




                          71321229





















                              0














                              It is basically a case when save actions is enabled in eclipse. When you put block comments using "Crtl + Shift + /" or by typing yourself as:



                              /*
                              line 1
                              line 2
                              line 3
                              */


                              and save it, the editor formats it to



                               /*
                              * line 1
                              * line 2
                              * line 3
                              */


                              * are added on each intermediate lines. This results "Crtl + Shift + " to fail to remove those "*" before the lines.



                              The solution is:



                              1- Use "Crtl + Shift + C" to comment and uncomment (toggle). Preferable one.



                              2- If you don't want to use "Crtl + Shift + C". This is a hack actually. When you save, the editor formats the code like:



                               /*
                              * line 1
                              * line 2
                              * line 3
                              */


                              You intermediately undo (Crtl + Z) it. The editor will put it back to earlier stage but code is saved like:



                              /*
                              line 1
                              line 2
                              line 3
                              */


                              Now you can use "Crtl + Shift + " to uncomment when needed. The * won't trouble you :)






                              share|improve this answer



























                                0














                                It is basically a case when save actions is enabled in eclipse. When you put block comments using "Crtl + Shift + /" or by typing yourself as:



                                /*
                                line 1
                                line 2
                                line 3
                                */


                                and save it, the editor formats it to



                                 /*
                                * line 1
                                * line 2
                                * line 3
                                */


                                * are added on each intermediate lines. This results "Crtl + Shift + " to fail to remove those "*" before the lines.



                                The solution is:



                                1- Use "Crtl + Shift + C" to comment and uncomment (toggle). Preferable one.



                                2- If you don't want to use "Crtl + Shift + C". This is a hack actually. When you save, the editor formats the code like:



                                 /*
                                * line 1
                                * line 2
                                * line 3
                                */


                                You intermediately undo (Crtl + Z) it. The editor will put it back to earlier stage but code is saved like:



                                /*
                                line 1
                                line 2
                                line 3
                                */


                                Now you can use "Crtl + Shift + " to uncomment when needed. The * won't trouble you :)






                                share|improve this answer

























                                  0












                                  0








                                  0







                                  It is basically a case when save actions is enabled in eclipse. When you put block comments using "Crtl + Shift + /" or by typing yourself as:



                                  /*
                                  line 1
                                  line 2
                                  line 3
                                  */


                                  and save it, the editor formats it to



                                   /*
                                  * line 1
                                  * line 2
                                  * line 3
                                  */


                                  * are added on each intermediate lines. This results "Crtl + Shift + " to fail to remove those "*" before the lines.



                                  The solution is:



                                  1- Use "Crtl + Shift + C" to comment and uncomment (toggle). Preferable one.



                                  2- If you don't want to use "Crtl + Shift + C". This is a hack actually. When you save, the editor formats the code like:



                                   /*
                                  * line 1
                                  * line 2
                                  * line 3
                                  */


                                  You intermediately undo (Crtl + Z) it. The editor will put it back to earlier stage but code is saved like:



                                  /*
                                  line 1
                                  line 2
                                  line 3
                                  */


                                  Now you can use "Crtl + Shift + " to uncomment when needed. The * won't trouble you :)






                                  share|improve this answer













                                  It is basically a case when save actions is enabled in eclipse. When you put block comments using "Crtl + Shift + /" or by typing yourself as:



                                  /*
                                  line 1
                                  line 2
                                  line 3
                                  */


                                  and save it, the editor formats it to



                                   /*
                                  * line 1
                                  * line 2
                                  * line 3
                                  */


                                  * are added on each intermediate lines. This results "Crtl + Shift + " to fail to remove those "*" before the lines.



                                  The solution is:



                                  1- Use "Crtl + Shift + C" to comment and uncomment (toggle). Preferable one.



                                  2- If you don't want to use "Crtl + Shift + C". This is a hack actually. When you save, the editor formats the code like:



                                   /*
                                  * line 1
                                  * line 2
                                  * line 3
                                  */


                                  You intermediately undo (Crtl + Z) it. The editor will put it back to earlier stage but code is saved like:



                                  /*
                                  line 1
                                  line 2
                                  line 3
                                  */


                                  Now you can use "Crtl + Shift + " to uncomment when needed. The * won't trouble you :)







                                  share|improve this answer












                                  share|improve this answer



                                  share|improve this answer










                                  answered Jan 25 '16 at 12:35









                                  DexterDexter

                                  1,44712129




                                  1,44712129





















                                      0














                                      This might not be as easy. But still it works!
                                      I use Ctrl+F to get the Find and Replace window, check the Regular expressions check box and use this regex ^(s*)/?*/?(.*)$ and 12 in the replace part and click "Replace All".
                                      If you want to uncomment only one commented code part, you can select that area and use the radio button "Selected lines" in the scope part.



                                      Regex break up

                                      ^ #denotes start of the line. To avoid matching * in other part of the code.
                                      ( #first group. To preserve the indentation
                                      s* #selects the tab/space. The indentation
                                      ) #first group is closed
                                      /? matches the forward slash in the first line of comment
                                      * matches the star(Asterik) in the comments. backward slash is used as a delimiter
                                      /? matches the forward slash in the last line of comment
                                      ( #second group. To preserve the indentation
                                      .* # the actual code to be uncommented
                                      ) #second group is closed
                                      $ # till the end of the line



                                      Hope this helps!






                                      share|improve this answer



























                                        0














                                        This might not be as easy. But still it works!
                                        I use Ctrl+F to get the Find and Replace window, check the Regular expressions check box and use this regex ^(s*)/?*/?(.*)$ and 12 in the replace part and click "Replace All".
                                        If you want to uncomment only one commented code part, you can select that area and use the radio button "Selected lines" in the scope part.



                                        Regex break up

                                        ^ #denotes start of the line. To avoid matching * in other part of the code.
                                        ( #first group. To preserve the indentation
                                        s* #selects the tab/space. The indentation
                                        ) #first group is closed
                                        /? matches the forward slash in the first line of comment
                                        * matches the star(Asterik) in the comments. backward slash is used as a delimiter
                                        /? matches the forward slash in the last line of comment
                                        ( #second group. To preserve the indentation
                                        .* # the actual code to be uncommented
                                        ) #second group is closed
                                        $ # till the end of the line



                                        Hope this helps!






                                        share|improve this answer

























                                          0












                                          0








                                          0







                                          This might not be as easy. But still it works!
                                          I use Ctrl+F to get the Find and Replace window, check the Regular expressions check box and use this regex ^(s*)/?*/?(.*)$ and 12 in the replace part and click "Replace All".
                                          If you want to uncomment only one commented code part, you can select that area and use the radio button "Selected lines" in the scope part.



                                          Regex break up

                                          ^ #denotes start of the line. To avoid matching * in other part of the code.
                                          ( #first group. To preserve the indentation
                                          s* #selects the tab/space. The indentation
                                          ) #first group is closed
                                          /? matches the forward slash in the first line of comment
                                          * matches the star(Asterik) in the comments. backward slash is used as a delimiter
                                          /? matches the forward slash in the last line of comment
                                          ( #second group. To preserve the indentation
                                          .* # the actual code to be uncommented
                                          ) #second group is closed
                                          $ # till the end of the line



                                          Hope this helps!






                                          share|improve this answer













                                          This might not be as easy. But still it works!
                                          I use Ctrl+F to get the Find and Replace window, check the Regular expressions check box and use this regex ^(s*)/?*/?(.*)$ and 12 in the replace part and click "Replace All".
                                          If you want to uncomment only one commented code part, you can select that area and use the radio button "Selected lines" in the scope part.



                                          Regex break up

                                          ^ #denotes start of the line. To avoid matching * in other part of the code.
                                          ( #first group. To preserve the indentation
                                          s* #selects the tab/space. The indentation
                                          ) #first group is closed
                                          /? matches the forward slash in the first line of comment
                                          * matches the star(Asterik) in the comments. backward slash is used as a delimiter
                                          /? matches the forward slash in the last line of comment
                                          ( #second group. To preserve the indentation
                                          .* # the actual code to be uncommented
                                          ) #second group is closed
                                          $ # till the end of the line



                                          Hope this helps!







                                          share|improve this answer












                                          share|improve this answer



                                          share|improve this answer










                                          answered Feb 1 '16 at 5:40









                                          RamRam

                                          3,16411733




                                          3,16411733





















                                              0














                                              1. Select the lines of code u wanna comment/uncomment.


                                              2. Then hit "Ctrl + / " to comment/uncomment.






                                              share|improve this answer



























                                                0














                                                1. Select the lines of code u wanna comment/uncomment.


                                                2. Then hit "Ctrl + / " to comment/uncomment.






                                                share|improve this answer

























                                                  0












                                                  0








                                                  0







                                                  1. Select the lines of code u wanna comment/uncomment.


                                                  2. Then hit "Ctrl + / " to comment/uncomment.






                                                  share|improve this answer













                                                  1. Select the lines of code u wanna comment/uncomment.


                                                  2. Then hit "Ctrl + / " to comment/uncomment.







                                                  share|improve this answer












                                                  share|improve this answer



                                                  share|improve this answer










                                                  answered Apr 13 '16 at 8:00









                                                  Dean WoodsDean Woods

                                                  12




                                                  12





















                                                      0














                                                      In Eclipse,
                                                      To add and remove single line comments,



                                                      CNTRL+SHIFT+C



                                                      Example:



                                                      // if(i==1)
                                                      // ...
                                                      //


                                                      To add and remove multi line comments,



                                                      CNTRL+SHIFT+/ --> add
                                                      CNTRL+SHIFT+ --> remove



                                                      Example:



                                                      /* if(i==1)
                                                      ...

                                                      */





                                                      share|improve this answer








                                                      New contributor




                                                      harsha is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                      Check out our Code of Conduct.
























                                                        0














                                                        In Eclipse,
                                                        To add and remove single line comments,



                                                        CNTRL+SHIFT+C



                                                        Example:



                                                        // if(i==1)
                                                        // ...
                                                        //


                                                        To add and remove multi line comments,



                                                        CNTRL+SHIFT+/ --> add
                                                        CNTRL+SHIFT+ --> remove



                                                        Example:



                                                        /* if(i==1)
                                                        ...

                                                        */





                                                        share|improve this answer








                                                        New contributor




                                                        harsha is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                        Check out our Code of Conduct.






















                                                          0












                                                          0








                                                          0







                                                          In Eclipse,
                                                          To add and remove single line comments,



                                                          CNTRL+SHIFT+C



                                                          Example:



                                                          // if(i==1)
                                                          // ...
                                                          //


                                                          To add and remove multi line comments,



                                                          CNTRL+SHIFT+/ --> add
                                                          CNTRL+SHIFT+ --> remove



                                                          Example:



                                                          /* if(i==1)
                                                          ...

                                                          */





                                                          share|improve this answer








                                                          New contributor




                                                          harsha is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                          Check out our Code of Conduct.










                                                          In Eclipse,
                                                          To add and remove single line comments,



                                                          CNTRL+SHIFT+C



                                                          Example:



                                                          // if(i==1)
                                                          // ...
                                                          //


                                                          To add and remove multi line comments,



                                                          CNTRL+SHIFT+/ --> add
                                                          CNTRL+SHIFT+ --> remove



                                                          Example:



                                                          /* if(i==1)
                                                          ...

                                                          */






                                                          share|improve this answer








                                                          New contributor




                                                          harsha is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                          Check out our Code of Conduct.









                                                          share|improve this answer



                                                          share|improve this answer






                                                          New contributor




                                                          harsha is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                          Check out our Code of Conduct.









                                                          answered Mar 6 at 16:24









                                                          harshaharsha

                                                          1




                                                          1




                                                          New contributor




                                                          harsha is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                          Check out our Code of Conduct.





                                                          New contributor





                                                          harsha is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                          Check out our Code of Conduct.






                                                          harsha is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                          Check out our Code of Conduct.



























                                                              draft saved

                                                              draft discarded
















































                                                              Thanks for contributing an answer to Stack Overflow!


                                                              • Please be sure to answer the question. Provide details and share your research!

                                                              But avoid


                                                              • Asking for help, clarification, or responding to other answers.

                                                              • Making statements based on opinion; back them up with references or personal experience.

                                                              To learn more, see our tips on writing great answers.




                                                              draft saved


                                                              draft discarded














                                                              StackExchange.ready(
                                                              function ()
                                                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f21724456%2funcomment-multiline-code-in-eclipse%23new-answer', 'question_page');

                                                              );

                                                              Post as a guest















                                                              Required, but never shown





















































                                                              Required, but never shown














                                                              Required, but never shown












                                                              Required, but never shown







                                                              Required, but never shown

































                                                              Required, but never shown














                                                              Required, but never shown












                                                              Required, but never shown







                                                              Required, but never shown







                                                              Popular posts from this blog

                                                              Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

                                                              Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

                                                              Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved