Bug 209426 - [typing] Auto-remove corresponding block comment start/end
Summary: [typing] Auto-remove corresponding block comment start/end
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.4   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-11 08:17 EST by Thomas Åhlén CLA
Modified: 2007-11-12 04:38 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Åhlén CLA 2007-11-11 08:17:34 EST
Two suggestions that would probably save a massive amount of time for many java developers!

S1. When using // in front of a line that denotes a block of java code automatically change the commenting to block commenting and surround the code. The change would happen instantly when I type the second /.

S2. When deleting a top block comment remove the bottom one automatically. The auto-removal of the / and */ would happen instantly when removing the * in /*.

See examples below.

I guess this feature would fit fine under 
Preferences->Java->Editor->Typing
-- When commenting ---
[] Line to block comments on multiline code structures
[] Automatic block comment removal

Thanks
Thomas

Example 1 (S1):
-Source
    for( int i = 0; i < 10; i++ )
    {
       ... some code ...
    }   
-Before
//    for( int i = 0; i < 10; i++ )
    {
       ... some code ...
    }   
-After
/*
    for( int i = 0; i < 10; i++ )
    {
       ... some code ...
    }   
*/

Example 2 (S1):
-Source
    canvas.getCamera().setFrustumPerspective( 45.0f,
                                              aspect,
                                              1,
                                              10000 );
-Before
//    canvas.getCamera().setFrustumPerspective( 45.0f,
                                              aspect,
                                              1,
                                              10000 );
-After
/*
    canvas.getCamera().setFrustumPerspective( 45.0f,
                                              aspect,
                                              1,
                                              10000 );
*/

Example 3 (S2):
-Source
/*
    for( int i = 0; i < 10; i++ )
    {
       ... some code ...
    }   
*/
-Before
/
    for( int i = 0; i < 10; i++ )
    {
       ... some code ...
    }   
*/
-After
    for( int i = 0; i < 10; i++ )
    {
       ... some code ...
    }
Comment 1 Dani Megert CLA 2007-11-12 04:38:07 EST
I like suggestion 2 but not suggestion 1. If you want to use /* to (un-) comment a block simply use Source > Add/Remove Block Comment.

I adjusted the summary.