Bug 39499

Summary: keyword completion does not work in anonymous inner classes
Product: [Eclipse Project] JDT Reporter: Kai-Uwe Maetzel <kai-uwe_maetzel>
Component: CoreAssignee: David Audel <david_audel>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: 3.0 M9   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Kai-Uwe Maetzel CLA 2003-07-01 05:44:59 EDT
Build I20030625:
Do not get completion proposals at indicated cursor position:

	public void createPartControl(Composite parent) {
		super.createPartControl(parent);
		getEditorSite().getSelectionProvider
().addSelectionChangedListener(new ISelectionChangedListener() {
			public void selectionChanged(SelectionChangedEvent 
event) {
				ISelection selection= event.getSelection();
				if (selection inst>I< )
			}
		});
	}
Comment 1 David Audel CLA 2004-01-22 12:07:46 EST
Problem still occurs in build 20040120

simple test case
public class X {
	public void foo() {
		bar(new Object() {
			public void toto(Object a) {
				if (a instanceof Object) {}
			}
		});
	}

	private void bar(Object o) {

	}
}

The problem does not occur with the following test case
public class X {
	public void foo() {
		new Object() {
			public void toto(Object a) {
				if (a instanceof Object) {}
			}
		};
	}

	private void bar(Object o) {

	}
}
Comment 2 David Audel CLA 2004-05-17 12:46:20 EDT
The problem was a bad usage indexOfAssistIdentifier() inside CompletionParser.

Fixed and test added
  CompletionParserTest2#test0142()
Comment 3 Olivier Thomann CLA 2004-05-18 11:03:18 EDT
Verified in 200405180816