Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 422901 - [1.8][code assist] Code assistant sensitive to scope.referenceContext type identity.
Summary: [1.8][code assist] Code assistant sensitive to scope.referenceContext type id...
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.4   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: BETA J8   Edit
Assignee: Srikanth Sankaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 416996 (view as bug list)
Depends on:
Blocks: 402079
  Show dependency tree
 
Reported: 2013-11-30 19:54 EST by Srikanth Sankaran CLA
Modified: 2014-02-03 05:01 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 Srikanth Sankaran CLA 2013-11-30 19:54:27 EST
BETA_JAVA8:

There are a bunch of checks in SelectionEngine + CompletionEngine that look
like the following:

    if (scope.referenceContext instanceof AbstractMethodDeclaration) {
        // ...
    }

All these places need to upgrade to LambdaExpression as a potential reference
context.

Example that breaks:

interface I {
	void foo();
}
public class X {
	public static void main(String[] args) {
		
		I i = () -> {
			syso|    // no proposals here.
		};
		
	}
}
Comment 1 Srikanth Sankaran CLA 2013-11-30 19:58:55 EST
*** Bug 416996 has been marked as a duplicate of this bug. ***
Comment 3 Noopur Gupta CLA 2014-01-29 08:55:31 EST
We still do not get the proposals in the following example:

interface I {
	void foo();
}
public class X {
	I i = () -> {
		syso|    // no proposals here.
	};
}
Comment 4 Srikanth Sankaran CLA 2014-02-03 05:01:09 EST
Fix and tests released here: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=BETA_JAVA8&id=5ceefbeb66afbd6b6f84ecf2da328f9e9c0ece67

We were setting the parent node of the completion node to be
the field declaration. This was inhibiting us from recognizing that
completion is occurring in a statement start location.