Bug 201762

Summary: Content Assist has no proposals with certain CU structure
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: David Audel <david_audel>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, jarthana, Olivier_Thomann, srikanth_sankaran
Version: 3.4   
Target Milestone: 3.6 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed fix none

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