Community
Participate
Working Groups
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.
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).
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 ***
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.