Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 406468 - [1.8][code assist] No completion proposals after the use of a constructor reference
Summary: [1.8][code assist] No completion proposals after the use of a constructor ref...
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.3   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: BETA J8   Edit
Assignee: ANIRBAN CHAKRABORTY CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 402079
  Show dependency tree
 
Reported: 2013-04-24 13:02 EDT by Srikanth Sankaran CLA
Modified: 2013-11-30 19:57 EST (History)
0 users

See Also:
srikanth_sankaran: review+


Attachments
Applicable regression clean patch (3.95 KB, patch)
2013-05-14 01:59 EDT, ANIRBAN CHAKRABORTY CLA
no flags Details | Diff
Patch after accommodating the review comments (3.92 KB, patch)
2013-05-15 16:17 EDT, ANIRBAN CHAKRABORTY CLA
no flags Details | Diff
Patch restraining irrelevant activities in reference expression scope (15.44 KB, patch)
2013-05-24 00:53 EDT, ANIRBAN CHAKRABORTY CLA
anchakrk: review?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Srikanth Sankaran CLA 2013-04-24 13:02:37 EDT
BETA_JAVA8: 

interface I {
	X [][][] copy (int x);
}
public class X  {
	public static void main(String[] args) {
		I i = X[][][]::new;
		X[][][] x = i.copy(136);
		System.out.println(x.length);
                |  // - no completion proposals here.		
	}
	
}
Comment 1 ANIRBAN CHAKRABORTY CLA 2013-05-05 03:02:39 EDT
I'm working on this.
Comment 2 ANIRBAN CHAKRABORTY CLA 2013-05-14 01:59:30 EDT
Created attachment 230924 [details]
Applicable regression clean patch

Applicable regression clean patch
Comment 3 Srikanth Sankaran CLA 2013-05-15 02:10:07 EDT
Anirban, Why won't similar changes be required in consumeReferenceExpressionGenericTypeForm ? Won't we leaving the
data structures dirty by not popping K_BETWEEN_NEW_AND_LEFT_BRACKET at
the right point ? 

I wonder if consumeIdentifierOrNew is a better place to pop this.

Alternately, if we don't push K_BETWEEN_NEW_AND_LEFT_BRACKET at all
for reference expressions, it would be better - after all we are NOT
between new and [
Comment 4 ANIRBAN CHAKRABORTY CLA 2013-05-15 05:42:35 EDT
(In reply to comment #3)
> Anirban, Why won't similar changes be required in
> consumeReferenceExpressionGenericTypeForm ? Won't we leaving the
> data structures dirty by not popping K_BETWEEN_NEW_AND_LEFT_BRACKET at
> the right point ? 
> 
> I wonder if consumeIdentifierOrNew is a better place to pop this.
> 
> Alternately, if we don't push K_BETWEEN_NEW_AND_LEFT_BRACKET at all
> for reference expressions, it would be better - after all we are NOT
> between new and [

Hello,
I'll re-submit a patch, in short time, by removing the token at after IdentifierOrNew is seen (and, ofcourse, ensuring the sanity of the patch).
Thanks
Anirban
Comment 5 ANIRBAN CHAKRABORTY CLA 2013-05-15 16:17:03 EDT
Created attachment 231044 [details]
Patch after accommodating the review comments

Patch after accommodating the review comments. K_BETWEEN_NEW_AND_LEFT_BRACKET is popped at consumeIdentifierOrNew.
Comment 6 ANIRBAN CHAKRABORTY CLA 2013-05-24 00:53:26 EDT
Created attachment 231428 [details]
Patch restraining irrelevant activities in reference expression scope

Patch restraining irrelevant activities in reference expression scope
Comment 7 Srikanth Sankaran CLA 2013-05-24 01:12:25 EDT
I made some simplifications:

    - Renamed inReferenceExpressionScope to be inReferenceExpression since these
constructs do not introduce a scope per se.
    - Localized the management of this state variable to CompletionParser.
There is no need for the main parser to be involved in what is only a completion
issue.
    - Centralized the state management by introducing a new override in 
CompletionParser rather than have the state managed in 4 different places.
    - Restructured the switch just a little bit to minimize the diffs and
have the delta stand out.

Released fix and test here: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=BETA_JAVA8&id=f0cc0529135fe43e5b6252dca937651f0a04d49c

Thanks Anirban.