View | Details | Raw Unified | Return to bug 167750
Collapse All | Expand All

(-)codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java (-2 / +8 lines)
Lines 2658-2665 Link Here
2658
					case TokenNameRIGHT_SHIFT: // or fred<X<X>>[(]1, 2) 
2658
					case TokenNameRIGHT_SHIFT: // or fred<X<X>>[(]1, 2) 
2659
					case TokenNameUNSIGNED_RIGHT_SHIFT: //or Fred<X<X<X>>>[(]1, 2)
2659
					case TokenNameUNSIGNED_RIGHT_SHIFT: //or Fred<X<X<X>>>[(]1, 2)
2660
						if (topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_SELECTOR) {
2660
						if (topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_SELECTOR) {
2661
							this.pushOnElementStack(K_SELECTOR_INVOCATION_TYPE, (this.invocationType == QUALIFIED_ALLOCATION) ? QUALIFIED_ALLOCATION : ALLOCATION);
2661
							if (topKnownElementKind(COMPLETION_OR_ASSIST_PARSER, 1) == K_BINARY_OPERATOR &&
2662
							this.pushOnElementStack(K_SELECTOR_QUALIFIER, this.qualifier);
2662
									topKnownElementInfo(COMPLETION_OR_ASSIST_PARSER, 1) == GREATER) {
2663
								// it's not a selector invocation
2664
								popElement(K_SELECTOR);
2665
							} else {
2666
								this.pushOnElementStack(K_SELECTOR_INVOCATION_TYPE, (this.invocationType == QUALIFIED_ALLOCATION) ? QUALIFIED_ALLOCATION : ALLOCATION);
2667
								this.pushOnElementStack(K_SELECTOR_QUALIFIER, this.qualifier);
2668
							}
2663
						}
2669
						}
2664
						this.qualifier = -1;
2670
						this.qualifier = -1;
2665
						this.invocationType = NO_RECEIVER;
2671
						this.invocationType = NO_RECEIVER;
(-)src/org/eclipse/jdt/core/tests/model/CompletionTests.java (+59 lines)
Lines 11685-11690 Link Here
11685
		}
11685
		}
11686
	}
11686
	}
11687
}
11687
}
11688
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=164311
11689
public void testBug164311() throws JavaModelException {
11690
	this.workingCopies = new ICompilationUnit[1];
11691
	this.workingCopies[0] = getWorkingCopy(
11692
		"/Completion/src/test/Test.java",
11693
		"package test;"+
11694
		"public class Test {\n" + 
11695
		"    public int zzzzzz;\n" + 
11696
		"    public void method1() {\n" + 
11697
		"        label : if (0> (10));\n" + 
11698
		"        zzz\n" + 
11699
		"    }\n" + 
11700
		"}\n");
11701
11702
	CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
11703
	String str = this.workingCopies[0].getSource();
11704
	String completeBehind = "zzz";
11705
	int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
11706
	this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
11707
11708
	assertResults(
11709
			"zzzzzz[FIELD_REF]{zzzzzz, Ltest.Test;, I, zzzzzz, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
11710
			requestor.getResults());
11711
}
11712
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=164311
11713
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=167750
11714
public void testBug164311_2() throws JavaModelException {
11715
	this.workingCopies = new ICompilationUnit[1];
11716
	this.workingCopies[0] = getWorkingCopy(
11717
		"/Completion/src/test/Test.java",
11718
		"package test;\n"+
11719
		"public class X {\n"+
11720
		"    public void zork() { \n"+
11721
		"    } \n"+
11722
		"    public void foo() { \n"+
11723
		"        this.foo(new Object(){\n"+
11724
		"            public void bar() {\n"+
11725
		"                if (zzz>(Integer)vvv.foo(i)) {\n"+
11726
		"                    return;\n"+
11727
		"                }\n"+
11728
		"                if (true) {\n"+
11729
		"                    return;\n"+
11730
		"                }\n"+
11731
		"                zor\n"+
11732
		"            }        \n"+    
11733
		"        });\n"+
11734
		"    }\n"+
11735
		"}\n");
11736
11737
	CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
11738
	String str = this.workingCopies[0].getSource();
11739
	String completeBehind = "zor";
11740
	int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
11741
	this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
11742
11743
	assertResults(
11744
			"zork[METHOD_REF]{zork(), Ltest.X;, ()V, zork, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
11745
			requestor.getResults());
11746
}
11688
public void testCompletionImportedType1() throws JavaModelException {
11747
public void testCompletionImportedType1() throws JavaModelException {
11689
    this.workingCopies = new ICompilationUnit[2];
11748
    this.workingCopies = new ICompilationUnit[2];
11690
    this.workingCopies[0] = getWorkingCopy(
11749
    this.workingCopies[0] = getWorkingCopy(

Return to bug 167750