Bug 201762 - Content Assist has no proposals with certain CU structure
Summary: Content Assist has no proposals with certain CU structure
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6 M1   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-30 12:08 EDT by Markus Keller CLA
Modified: 2009-08-04 08:18 EDT (History)
4 users (show)

See Also:


Attachments
Proposed fix (14.64 KB, patch)
2009-06-29 07:25 EDT, David Audel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2007-08-30 12:08:24 EDT
I20070828-0800, same problem in 3.3

Content assist where indicated below does not work (in a plug-in project with SWT on the classpath).

But when I remove either the "shell.addControlListener..." or the "while..." statement, it works as expected. Nothing in the log. Veeery strange!


import org.eclipse.swt.*;
import org.eclipse.swt.events.*;
import org.eclipse.swt.widgets.*;

public class Try {

    void main(Shell shell) {
        
        final Label label= new Label(shell, SWT.WRAP);
        label.addPaintListener(new PaintListener() {
            public void paintControl(PaintEvent e) {
                e.gc.setLineCap(SWT.CAP_); // content assist after CAP_
            }
        });
        
        shell.addControlListener(new ControlAdapter() { });
        
        while (!shell.isDisposed()) { }
    }
}
Comment 1 David Audel CLA 2009-06-29 07:25:48 EDT
Created attachment 140359 [details]
Proposed fix

Content assist was fixed by a previous fix but the recovered ast is not correct.

With this patch the recovered ast will be correct. The closing braces after a statement are not correctly recovered.
Comment 2 David Audel CLA 2009-06-29 07:29:56 EDT
Released for 3.6M1.

Tests added
  DietRecoveryTest#test127() -> test128()
  CompletionRecoveryTest#test26()
  CompletionTests#test201762()
Comment 3 Jay Arthanareeswaran CLA 2009-08-04 00:35:31 EDT
Verified for 3.6M1 using I20090802-2000