Bug 93141 - [quick fix] assign to local content suggest missing when error on next line
Summary: [quick fix] assign to local content suggest missing when error on next line
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 42253
Blocks:
  Show dependency tree
 
Reported: 2005-04-28 12:19 EDT by Darin Wright CLA
Modified: 2006-02-16 06:10 EST (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 Darin Wright CLA 2005-04-28 12:19:38 EDT
I20050526-1700

Not sure if this is JUI or JCORE.

Content suggest does not work when there is a compilation error on the 
following line. For example, in the method below, a semi-colon is missing 
in "Map map = new HashMap()", which causes the suggestion to "assign to local" 
to *not* appear for the preceeding line "new Vector();".

    public void testCapacityOne() {
    	String foo = "123fhasjkfhda";
    	new Vector(); // CONTENT ASSIST HERE
        Map map = new HashMap()
        int size= fFullest.size(); 
        for (int i= 0; i < 100; i++) {
            fFullest.addElement(new Integer(i));
            map.put(new Integer(i), Integer.toHexString(i));
        }
        assertTrue(fFullest.size() == 100+size);
    }
Comment 1 David Audel CLA 2005-04-29 06:19:39 EDT
"assign to local"  is a Quick Fix.

Move to JDT/UI
Comment 2 Dirk Baeumer CLA 2005-04-29 13:17:24 EDT
Darin, you are talking about quick assist not content assist. Right ?
Comment 3 Darin Wright CLA 2005-04-29 13:49:47 EDT
I don't know the name for it :-) It's the suggestion to "assign to local" for 
an expression that has not been assigned to a variable.
Comment 4 Martin Aeschlimann CLA 2005-05-02 08:35:57 EDT
The missing semicolon prevents the creation of any AST statements in the block.
Without any AST we can't suuggest quick fixes.
The AST should be more fault tolerant here.

Moving to jdt.core
Comment 5 David Audel CLA 2005-05-02 09:06:54 EDT

*** This bug has been marked as a duplicate of 42253 ***
Comment 6 Frederic Fusier CLA 2006-02-15 11:35:22 EST
Reopen. This bug is not a duplicate of bug 42253 but depends on it...
I'm still not able to get correct quick-fix even with robust AST enabled...
Comment 7 Frederic Fusier CLA 2006-02-15 11:36:34 EST
Move to JDT/UI for comment. There should be nothing preventing JDT/UI to propose the quick-fix as I can see all statements in ASTView.
Comment 8 Martin Aeschlimann CLA 2006-02-16 05:30:00 EST
I get the 'Assign statement to local' proposal' set the cursor on before 'new' or select the whole statement'. Frederic?
Tested with I20060216-0010
Comment 9 Frederic Fusier CLA 2006-02-16 06:10:32 EST
It's OK, I was looking for a quick-fix on Map map =... line...
Sorry for the confusion