View | Details | Raw Unified | Return to bug 185576 | Differences between
and this patch

Collapse All | Expand All

(-)codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java (-1 / +1 lines)
Lines 6499-6505 Link Here
6499
		
6499
		
6500
		if (!skip && proposeType && scope.enclosingSourceType() != null) {
6500
		if (!skip && proposeType && scope.enclosingSourceType() != null) {
6501
			findNestedTypes(token, scope.enclosingSourceType(), scope, proposeAllMemberTypes, typesFound);
6501
			findNestedTypes(token, scope.enclosingSourceType(), scope, proposeAllMemberTypes, typesFound);
6502
			if(!assistNodeIsConstructor && !assistNodeIsAnnotation) {
6502
			if((!assistNodeIsConstructor && !assistNodeIsAnnotation) && this.assistNodeInJavadoc == 0) {
6503
				// don't propose type parameters if the completion is a constructor ('new |')
6503
				// don't propose type parameters if the completion is a constructor ('new |')
6504
				findTypeParameters(token, scope);
6504
				findTypeParameters(token, scope);
6505
			}
6505
			}
(-)src/org/eclipse/jdt/core/tests/model/JavadocBugsCompletionModelTest.java (+53 lines)
Lines 1058-1061 Link Here
1058
	completeInJavadoc("/Completion/src/bugs/b171031/BasicTestBugs.java", source, true, "@In", 1);
1058
	completeInJavadoc("/Completion/src/bugs/b171031/BasicTestBugs.java", source, true, "@In", 1);
1059
	assertSortedResults(""); // should not have any proposal as 
1059
	assertSortedResults(""); // should not have any proposal as 
1060
}
1060
}
1061
1062
/**
1063
 * @bug 185576: [javadoc][assist] Type parameters should not be proposed while completing in @link or @see reference
1064
 * @test Do not include type params in Javadoc content assist proposals 
1065
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=185576"
1066
 */
1067
public void testONLY_Bug185576a() throws JavaModelException {
1068
	setUpProjectOptions(CompilerOptions.VERSION_1_5);
1069
	String source =
1070
		"package bugs.b185576;\n" + 
1071
		"public class BasicTestBugs {\n" + 
1072
		"	/**\n" + 
1073
		"	 * The return type is {@link } and that is all.  \n" + 
1074
		"	 * \n" + 
1075
		"	 * @param <X>\n" + 
1076
		"	 * @param t\n" + 
1077
		"	 * @return something.\n" + 
1078
		"	 */\n" + 
1079
		"	public <X> X foooo(X t) {\n" + 
1080
		"		return null;\n" + 
1081
		"	}\n" + 
1082
		"}\n";
1083
	completeInJavadoc("/Completion/src/bugs/b185576/BasicTestBugs.java", source, true, "@link ", 0);
1084
	String emptyPositions = "["+this.completionStart+", "+this.completionStart+"], ";
1085
	assertSortedResults(
1086
		"BasicTestBugs[TYPE_REF]{BasicTestBugs, bugs.b185576, Lbugs.b185576.BasicTestBugs;, null, null, "+emptyPositions+R_DRICUNR+"}"
1087
	);
1088
}
1089
1090
public void testONLY_Bug185576b() throws JavaModelException {
1091
	setUpProjectOptions(CompilerOptions.VERSION_1_5);
1092
	String source =
1093
		"package bugs.b185576;\n" + 
1094
		"public class BasicTestBugs {\n" + 
1095
		"	/**\n" + 
1096
		"	 * The return type is {@link } and that is all.  \n" + 
1097
		"	 * \n" + 
1098
		"	 * @param <X>\n" + 
1099
		"	 * @param t\n" + 
1100
		"	 * @return something.\n" + 
1101
		"	 */\n" + 
1102
		"	public <X> X foooo(X t) {\n" + 
1103
		"		return null;\n" + 
1104
		"	}\n" + 
1105
		"  class X {}\n" +
1106
		"}\n";
1107
	completeInJavadoc("/Completion/src/bugs/b185576/BasicTestBugs.java", source, true, "@link ", 0);
1108
	String emptyPositions = "["+this.completionStart+", "+this.completionStart+"], ";
1109
	assertSortedResults(
1110
		"BasicTestBugs[TYPE_REF]{BasicTestBugs, bugs.b185576, Lbugs.b185576.BasicTestBugs;, null, null, "+emptyPositions+R_DRICUNR+"}\n" + 
1111
		"BasicTestBugs.X[TYPE_REF]{X, bugs.b185576, Lbugs.b185576.BasicTestBugs$X;, null, null, "+emptyPositions+R_DRICUNR+"}"
1112
	);
1113
}
1061
}
1114
}
(-)src/org/eclipse/jdt/core/tests/model/AbstractJavadocCompletionModelTest.java (-1 / +1 lines)
Lines 347-356 Link Here
347
		assertNoProblem(sources[0]);
347
		assertNoProblem(sources[0]);
348
348
349
		// Store replacement info
349
		// Store replacement info
350
		int endPosition = this.cursorLocation;
350
		if (occurencePosition == 0) { // special case for completion on empty token...
351
		if (occurencePosition == 0) { // special case for completion on empty token...
351
			this.completionStart = this.cursorLocation;
352
			this.completionStart = this.cursorLocation;
352
		}
353
		}
353
		int endPosition = this.cursorLocation;
354
		char ch = source.charAt(endPosition);
354
		char ch = source.charAt(endPosition);
355
		if (Character.isJavaIdentifierPart(ch) || ch == '>' || ch == '}' || ch == '(' || ch == ')') {
355
		if (Character.isJavaIdentifierPart(ch) || ch == '>' || ch == '}' || ch == '(' || ch == ')') {
356
			do {
356
			do {

Return to bug 185576