Bug 498587 - Block Comment handler
Summary: Block Comment handler
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: IDE (show other bugs)
Version: 4.5   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-27 11:15 EDT by Nicholas Bretagna CLA
Modified: 2016-07-27 11:15 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicholas Bretagna CLA 2016-07-27 11:15:49 EDT
Currently, Block Comment (ctrl-shift-/) does smartly disable nested comments, e.g.,

vvvvvvvv Selected
Text

/* already blocked
this too
*/

More Text
^^^^^^ Selected

becomes

/* 
Text
* already blocked
this too
*
More Text
*/ 

The problem goes when you seek to reverse this, with ctrl-shift-\
There's no way to restore the existing block comment as it is done.

Suggest that the existing block comment could be dealt with in a manner that Eclipse could recognize as a restorable comment, to wit:

/* 
Text
//1\\ already blocked
this too
//1\\
More Text
*/ 

Then, when you use the reverse block it would remove the block and restore the //1\\ to a /* */ pair.

Ideally, the use of the number makes it so it could deal properly with nested-nesting (//2\\, etc.), but that's at least a bit out there.

I suggest this deals fairly elegantly with the problem. Someone could mess up a bit by removing the added block /* */ by hand, but it does provide the capacity to temporarily dyke out some code and not worry about existing block comments being messed up.