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

(-)codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionJavadocParser.java (-2 / +3 lines)
Lines 642-648 Link Here
642
								}
642
								}
643
								this.scanner.tokenizeWhiteSpace = true;
643
								this.scanner.tokenizeWhiteSpace = true;
644
								if (this.completionNode != null) {
644
								if (this.completionNode != null) {
645
									int flags = CompletionOnJavadoc.TEXT|CompletionOnJavadoc.ONLY_INLINE_TAG;
645
									int flags = this.inlineTagStarted ? 0 : CompletionOnJavadoc.TEXT|CompletionOnJavadoc.ONLY_INLINE_TAG;
646
									if (member instanceof JavadocMessageSend) {
646
									if (member instanceof JavadocMessageSend) {
647
										JavadocMessageSend msgSend = (JavadocMessageSend) member;
647
										JavadocMessageSend msgSend = (JavadocMessageSend) member;
648
										this.completionNode = new CompletionOnJavadocMessageSend(msgSend, this.memberStart, flags);
648
										this.completionNode = new CompletionOnJavadocMessageSend(msgSend, this.memberStart, flags);
Lines 763-771 Link Here
763
			consumeToken();
763
			consumeToken();
764
764
765
			if (this.completionNode != null) {
765
			if (this.completionNode != null) {
766
				this.completionNode.addCompletionFlags(CompletionOnJavadoc.TEXT);
767
				if (this.inlineTagStarted) {
766
				if (this.inlineTagStarted) {
768
					this.completionNode.addCompletionFlags(CompletionOnJavadoc.FORMAL_REFERENCE);
767
					this.completionNode.addCompletionFlags(CompletionOnJavadoc.FORMAL_REFERENCE);
768
				} else {
769
					this.completionNode.addCompletionFlags(CompletionOnJavadoc.TEXT);
769
				}
770
				}
770
			}
771
			}
771
		}
772
		}
(-)src/org/eclipse/jdt/core/tests/compiler/parser/JavadocCompletionParserTest.java (-1 / +1 lines)
Lines 391-397 Link Here
391
	verifyCompletionInJavadoc(source, "Obj");
391
	verifyCompletionInJavadoc(source, "Obj");
392
	assertCompletionNodeResult(source,
392
	assertCompletionNodeResult(source,
393
		"<CompletionOnJavadocSingleTypeReference:Obj\n" + 
393
		"<CompletionOnJavadocSingleTypeReference:Obj\n" + 
394
		"	infos:text,formal reference\n" + 
394
		"	infos:formal reference\n" + 
395
		">"
395
		">"
396
	);
396
	);
397
}
397
}
(-)src/org/eclipse/jdt/core/tests/model/JavadocBugsCompletionModelTest.java (+23 lines)
Lines 788-791 Link Here
788
		"BasicTestBugs.Inner.Level2[TYPE_REF]{Level2, bugs.b118397, Lbugs.b118397.BasicTestBugs$Inner$Level2;, null, null, "+this.positions+R_DICNR+"}"
788
		"BasicTestBugs.Inner.Level2[TYPE_REF]{Level2, bugs.b118397, Lbugs.b118397.BasicTestBugs$Inner$Level2;, null, null, "+this.positions+R_DICNR+"}"
789
	);
789
	);
790
}
790
}
791
792
/**
793
 * Bug 144866: [assist][javadoc] Wrong completion inside @value tag
794
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=144866"
795
 */
796
public void testBug144866() throws JavaModelException {
797
	String source =
798
		"package bugs.b144866;\n" + 
799
		"public class BasicTestBugs {\n" + 
800
		"	public static int EXAMPLE = 0;\n" + 
801
		"	/**\n" + 
802
		"	 * This method returns an object\n" + 
803
		"	 * @see Object\n" + 
804
		"	 * 	This method will use {@value #EX } constant value...\n" + 
805
		"	 */\n" + 
806
		"	public void foo() {\n" + 
807
		"	}\n" + 
808
		"}\n";
809
	completeInJavadoc("/Completion/src/bugs/b144866/BasicTestBugs.java", source, true, "EX", 2); // 2nd occurence
810
	assertSortedResults(
811
		"EXAMPLE[FIELD_REF]{EXAMPLE, Lbugs.b144866.BasicTestBugs;, I, EXAMPLE, null, "+this.positions+R_DICNR+"}"
812
	);
813
}
791
}
814
}
(-)src/org/eclipse/jdt/core/tests/model/JavadocTextCompletionModelTest.java (-2 / +2 lines)
Lines 459-467 Link Here
459
		"	 */\n" + 
459
		"	 */\n" + 
460
		"	int foo;\n" + 
460
		"	int foo;\n" + 
461
		"}";
461
		"}";
462
	completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.java", source, true, "#fo");
462
	completeInJavadoc("/Completion/src/javadoc/text/BasicTestTextIns.java", source, true, "fo");
463
	assertSortedResults(
463
	assertSortedResults(
464
		"foo[JAVADOC_FIELD_REF]{{@link #foo}, Ljavadoc.text.BasicTestTextIns;, I, foo, null, "+this.positions+R_DICNRNSIT+"}"
464
		"foo[FIELD_REF]{foo, Ljavadoc.text.BasicTestTextIns;, I, foo, null, "+this.positions+R_DICNRNS+"}"
465
	);
465
	);
466
}
466
}
467
467

Return to bug 144866