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

(-)codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java (-3 / +1 lines)
Lines 5201-5208 Link Here
5201
		if (typeName == null)
5201
		if (typeName == null)
5202
			return;
5202
			return;
5203
5203
5204
		if (this.assistNodeIsSuperType && !this.insideQualifiedReference) return; // we're trying to find a supertype
5205
5206
		if (this.insideQualifiedReference
5204
		if (this.insideQualifiedReference
5207
			|| typeName.length == 0) { // do not search up the hierarchy
5205
			|| typeName.length == 0) { // do not search up the hierarchy
5208
5206
Lines 5369-5375 Link Here
5369
		if (typeName == null || typeName.length == 0)
5367
		if (typeName == null || typeName.length == 0)
5370
			return;
5368
			return;
5371
5369
5372
		if (this.assistNodeIsSuperType && !this.insideQualifiedReference) return; // we're trying to find a supertype
5370
		if (this.assistNodeIsSuperType && !this.insideQualifiedReference && this.isForbidden(currentType)) return; // we're trying to find a supertype
5373
5371
5374
		findMemberTypes(
5372
		findMemberTypes(
5375
				typeName,
5373
				typeName,
(-)src/org/eclipse/jdt/core/tests/model/CompletionTests.java (+55 lines)
Lines 5762-5767 Link Here
5762
			requestor.getResults());
5762
			requestor.getResults());
5763
}
5763
}
5764
5764
5765
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=212713
5766
public void testCompletionInsideExtends13() throws JavaModelException {
5767
	this.workingCopies = new ICompilationUnit[1];
5768
	this.workingCopies[0] = getWorkingCopy(
5769
		"/Completion/src/test/Test.java",
5770
		"package test;\n"+
5771
		"public class Test {\n"+
5772
		"        static class GrrrBug {}\n"+
5773
		"        class Foo extends Grrr\n"+
5774
		"}\n");
5775
5776
	CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
5777
	String str = this.workingCopies[0].getSource();
5778
	String completeBehind = "Grrr";
5779
	int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
5780
	this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
5781
5782
	assertResults(
5783
			"Test.GrrrBug[TYPE_REF]{GrrrBug, test, Ltest.Test$GrrrBug;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CLASS + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
5784
			requestor.getResults());
5785
}
5786
5787
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=212713
5788
public void testCompletionInsideExtends14() throws JavaModelException {
5789
	this.workingCopies = new ICompilationUnit[1];
5790
	this.workingCopies[0] = getWorkingCopy(
5791
		"/Completion/src/test/GrrrBug1.java",
5792
		"package test;\n"+
5793
		"public class GrrrBug1 {\n"+
5794
		"	public static class GrrrBug2 {\n"+
5795
		"		public static class GrrrBug3 {}\n"+
5796
 		"       }\n"+
5797
		"	public static class GrrrBug4 extends Grrr {\n"+
5798
		"		public static class GrrrBug5 {}\n"+
5799
		"    }\n"+
5800
		"}\n"+
5801
		"class GrrrBug6 {\n"+
5802
		"	public static class GrrrBug7 {}\n"+
5803
		"}\n");
5804
5805
	CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
5806
	String str = this.workingCopies[0].getSource();
5807
	String completeBehind = "extends Grrr";
5808
	int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
5809
	this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
5810
5811
	assertResults(
5812
			"GrrrBug1.GrrrBug2.GrrrBug3[TYPE_REF]{test.GrrrBug1.GrrrBug2.GrrrBug3, test, Ltest.GrrrBug1$GrrrBug2$GrrrBug3;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CLASS + R_CASE + R_NON_RESTRICTED) + "}\n" +
5813
			"GrrrBug6.GrrrBug7[TYPE_REF]{test.GrrrBug6.GrrrBug7, test, Ltest.GrrrBug6$GrrrBug7;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CLASS + R_CASE + R_NON_RESTRICTED) + "}\n" +
5814
			"GrrrBug1[TYPE_REF]{GrrrBug1, test, Ltest.GrrrBug1;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CLASS + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
5815
			"GrrrBug1.GrrrBug2[TYPE_REF]{GrrrBug2, test, Ltest.GrrrBug1$GrrrBug2;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CLASS + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
5816
			"GrrrBug6[TYPE_REF]{GrrrBug6, test, Ltest.GrrrBug6;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CLASS + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
5817
			requestor.getResults());
5818
}
5819
5765
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=78151
5820
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=78151
5766
public void testCompletionInsideExtends2() throws JavaModelException {
5821
public void testCompletionInsideExtends2() throws JavaModelException {
5767
	this.wc = getWorkingCopy(
5822
	this.wc = getWorkingCopy(

Return to bug 210681