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

(-)codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java (-1 / +1 lines)
Lines 1747-1753 Link Here
1747
								contextAccepted = true;
1747
								contextAccepted = true;
1748
								buildContext(importReference, null, parsedUnit, null, null);
1748
								buildContext(importReference, null, parsedUnit, null, null);
1749
1749
1750
								long positions = importReference.sourcePositions[importReference.sourcePositions.length - 1];
1750
								long positions = importReference.sourcePositions[importReference.tokens.length - 1];
1751
								setSourceAndTokenRange((int) (positions >>> 32), (int) positions);
1751
								setSourceAndTokenRange((int) (positions >>> 32), (int) positions);
1752
1752
1753
								char[][] oldTokens = importReference.tokens;
1753
								char[][] oldTokens = importReference.tokens;
(-)src/org/eclipse/jdt/core/tests/model/CompletionTests.java (+60 lines)
Lines 6051-6056 Link Here
6051
			requestor.getResults());
6051
			requestor.getResults());
6052
}
6052
}
6053
6053
6054
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=243406
6055
public void testCompletionImportedType7() throws JavaModelException {
6056
	this.workingCopies = new ICompilationUnit[3];
6057
	this.workingCopies[0] = getWorkingCopy(
6058
		"/Completion/src/test/Test.java",
6059
		"package test;"+
6060
		"import AClas.Foo;"+
6061
		"public class Test {\n"+
6062
		"  \n"+
6063
		"}");
6064
6065
	this.workingCopies[1] = getWorkingCopy(
6066
		"/Completion/src/test2/AClass1.java",
6067
		"package test2;"+
6068
		"public class AClass {"+
6069
		"}");
6070
6071
	CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true);
6072
	String str = this.workingCopies[0].getSource();
6073
	String completeBehind = "AClas";
6074
	int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
6075
	this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
6076
6077
	int start = str.indexOf("AClas");
6078
	int end = start + "AClas".length();
6079
	assertResults(
6080
			"AClass[TYPE_REF]{test2.AClass;, test2, Ltest2.AClass;, null, null, ["+start+", "+end+"], " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
6081
			requestor.getResults());
6082
}
6083
6084
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=243406
6085
public void testCompletionImportedType8() throws JavaModelException {
6086
	this.workingCopies = new ICompilationUnit[3];
6087
	this.workingCopies[0] = getWorkingCopy(
6088
		"/Completion/src/test/Test.java",
6089
		"package test;"+
6090
		"import test2.AClas.Foo;"+
6091
		"public class Test {\n"+
6092
		"  \n"+
6093
		"}");
6094
6095
	this.workingCopies[1] = getWorkingCopy(
6096
		"/Completion/src/test2/AClass1.java",
6097
		"package test2;"+
6098
		"public class AClass {"+
6099
		"}");
6100
6101
	CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true);
6102
	String str = this.workingCopies[0].getSource();
6103
	String completeBehind = "AClas";
6104
	int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
6105
	this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
6106
6107
	int start = str.indexOf("AClas");
6108
	int end = start + "AClas".length();
6109
	assertResults(
6110
			"AClass[TYPE_REF]{AClass;, test2, Ltest2.AClass;, null, null, ["+start+", "+end+"], " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
6111
			requestor.getResults());
6112
}
6113
6054
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=78151
6114
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=78151
6055
public void testCompletionInsideExtends1() throws JavaModelException {
6115
public void testCompletionInsideExtends1() throws JavaModelException {
6056
	this.wc = getWorkingCopy(
6116
	this.wc = getWorkingCopy(

Return to bug 243406