Bug 75365 - Autocompleting semicolon ;
Summary: Autocompleting semicolon ;
Status: RESOLVED DUPLICATE of bug 49363
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P4 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-30 04:27 EDT by Sathish R CLA
Modified: 2004-10-07 01:46 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 Sathish R CLA 2004-09-30 04:27:22 EDT
Missing semicolon
int a = 3

Eclipse should make this as
int a = 3;

Rather than displaying , Missing semicolon error

String s = new("sdfdsaf")

Eclipse should make this as

String s =  new String("sdfdsaf");

Rather than displaying Syntax error.

for(every String i in collection)
{

}

should be coverted into

for(Iterator itr = collection.iterator();itr.hasnext();)
{
i = (String)itr.next();

}

These 3 replacements improve usability of Eclipse Java editor UI.
Comment 1 Markus Keller CLA 2004-09-30 05:44:52 EDT
Please open separate reports for different requests.

(1) Auto-insert missing semicolon:
Related to bug 49363. When exactly would you expect Eclipse to insert the
semicolon? We can only know that there's a missing semicolon after having parsed
the whole compilation unit. A QuickFix for this would not be very usefull, since
you can just enter a ; to fix the error.

(2) This is just syntactically wrong code, and we won't correct such things.
Eclipse has better ways to ease input:
a)
- write new String("sdfdsaf");
- press Ctrl+1 and select 'Assign statement to new local variable' by pressing Enter
b)
- write "new"
- press Ctrl+Space, select 'new - create new object' and press Enter
- fill the boxed fields, Tab to next

(3) We won't convert different languages to Java. In Eclipse, you do it like this:
- Collection collection = ...;
- type "for", press Ctrl+Space, and choose the template 'for - iterate over
    collection'
- enter text in the linked boxes, press Tab to move to next field

Adapted summary to represent (1), since we won't do (2) and (3).
Comment 2 Dirk Baeumer CLA 2004-10-04 09:11:55 EDT
Fully agree with Markus statements regarding (2) & (3).

Marking as dup of bug 49363. The request goes into the same direction (auto 
correct on typing)

*** This bug has been marked as a duplicate of 49363 ***
Comment 3 Sathish R CLA 2004-10-07 01:46:14 EDT
There are 15-20 related bugs to this semicolon issue. Some how i missed on my
earlier query.

Compilation - When it is set to automatic, takes less time than inserting a semi
colon. You need not wait for a syntax error, You can insert the semi colon to
prevent syntax error.

As for as 'new' and 'for' are concerned, the template insertion technique is
good, but not sufficient for new.

I think autocompleting the type will enhance usability.