Bug 153662 - [projection] Boilerplate Collapsing
Summary: [projection] Boilerplate Collapsing
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P5 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-11 19:50 EDT by Ricky Clarkson CLA
Modified: 2007-06-22 10:02 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 Ricky Clarkson CLA 2006-08-11 19:50:27 EDT
When someone first said "live templates" in the context of IDEA to me, I thought they would be something interesting (defined below), but it turned out they weren't.

When editing Java code, we all know there is some boilerplate, e.g.:

new Thread(new Runnable(){public void run(){callMethod();}}).start(); is considerably larger than the intended (non-Java):
new Thread(callMethod();}.start();

I think it would be possible, and useful, for Eclipse to provide a means of collapsing certain boilerplate code, such as the above, in a similar way to the way that code folding works.
Comment 1 Dani Megert CLA 2006-08-15 03:13:51 EDT
Bug 60929 would already help here.
Comment 2 Ricky Clarkson CLA 2006-08-15 08:49:54 EDT
(In reply to comment #1)
> Bug 60929 would already help here.
> 

In the comments on Bug 60929, R.J.Lorimer links to a plugin he wrote.  From that page:

"Due to limitations in the current Eclipse API for code folding, lines that are shared by more than one fold cannot be split down the middle (in other words, folds are line-by-line, not character-by-character)"

That might make this impossible, or at least hard, e.g. for cases like:

doTheseTwoThings(new Runnable(){public void run(){x();}},new Runnable(){public void run(){y();}});

..to be collapsed to:
doTheseTwoThings({x();},{y();});
Comment 3 Dani Megert CLA 2007-06-22 09:59:31 EDT
Get rid of deprecated state.