Bug 7213 - Surround with features (and templates) [refactoring] [code manipulation]
Summary: Surround with features (and templates) [refactoring] [code manipulation]
Status: RESOLVED DUPLICATE of bug 21825
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P4 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Erich Gamma CLA
QA Contact:
URL:
Whiteboard:
Keywords: investigate
: 6652 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-01-02 11:45 EST by vin CLA
Modified: 2002-08-30 08:01 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description vin CLA 2002-01-02 11:45:41 EST
Surround with features in Eclipse would make it a killer IDE. These are the 
things that save developer effort while coding. 

Essentially a user selects and highlights some code and chooses a surround with 
option to surround the code with other code.

Option 1:

This feature could be integrated with templates capability so that users could 
design their own surround with templates. The essential difference would be 
that for a regular template nothing is highlighted when user presses ctl-
spacebar. For a "surround template" the user highlights a piece of code and 
presses ctl-spacebar.

Option 2:

If this feature is not integrated with template feature, user would select and 
highlight some code, press a key combination and a menu could be thrown to 
select some hard coded surround with options.


Following surround with features are commonly found in other ides and requested:

if
if/else
while
do/while
for
try/catch
try/finally
try/catch/finally
synchronized
Runnable

Thanks and Regards,

Vin
Comment 1 Dirk Baeumer CLA 2002-01-10 09:22:40 EST
Surround with try/catch is present in build 20020109. There is no commitment to 
implement others for 2.0.
Comment 2 Erich Gamma CLA 2002-05-04 14:29:34 EDT
deferring other surround with options to after 2.0
Comment 3 Dirk Baeumer CLA 2002-07-24 09:58:57 EDT
For 2.1 we should look for the following:

- try/finally
- extend try/catch/finally
- runnable
- synchronized

IMO they are the most important ones
Comment 4 vin CLA 2002-07-24 13:58:21 EDT
Dirk Baeumer wrote:

>For 2.1 we should look for the following:
>
>- try/finally
>- extend try/catch/finally
>- runnable
>- synchronized
>
>IMO they are the most important ones

The number of times someone codes a "for", "while", or "if/else" statement in 
their program tends to be much higher than the above. Developers would 
therefore benefit much more if these are handled first. Since try/catch is 
already there, ading finally should be just a matter of appending additional 
text to it. 

Runnable and Synchronized are usually put in code by a developer after a lot of 
thought (unlike for/while/if-else) and tend to be not as frequently occuring 
(and are easily done by hand).

As a result you are solving the problem for 4-8% of the market (Runnable and 
Synchronized )and leaving behind the much bigger share. 

Also, the whole idea here is to help code fast. If you help code fast only for 
4-8% of code, what is the benefit achived? Instead if you target more common 
constructs, you would be helping every one a great deal.

I wish I had the skills to do this kind of stuff. I am more of an application 
developer but I do a lot of code reviews. I can assure you that the overall 
effort and time spent in enclosing code with "if/for/while" is much much more 
than that spent on runnable and synchronized. 

If you save 10,000 programmer hours/month as a result of surround 
with "if/for/while" it would be much better that saving mere 500 programmer 
hours/month for the eclipse community (of today).

Hope you would give a second thought to which once to do first.

Thanks and Regards,

Vinay Soni


Comment 5 Dirk Baeumer CLA 2002-07-25 14:29:11 EDT
The reason why I proposed those was that we can provide some smartness for 
them. But I agree that the other are more common.
Comment 6 Dirk Baeumer CLA 2002-07-25 14:29:37 EDT
*** Bug 6652 has been marked as a duplicate of this bug. ***
Comment 7 Claude Knaus CLA 2002-08-30 08:00:48 EDT
reopen for mark as duplicate
Comment 8 Claude Knaus CLA 2002-08-30 08:01:29 EDT

*** This bug has been marked as a duplicate of 21825 ***