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

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java (+29 lines)
Lines 8816-8819 Link Here
8816
			"Test2[TYPE_REF]{Test2, test, Ltest.Test2;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
8816
			"Test2[TYPE_REF]{Test2, test, Ltest.Test2;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_EXPECTED_TYPE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
8817
			requestor.getResults());
8817
			requestor.getResults());
8818
}
8818
}
8819
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=154993
8820
public void test0297() throws JavaModelException {
8821
	this.workingCopies = new ICompilationUnit[2];
8822
	this.workingCopies[0] = getWorkingCopy(
8823
			"/Completion/src3/test/Test.java",
8824
			"package test;\n" +
8825
			"public class Test {\n" +
8826
			"    String description = \"Some description\";\n" +
8827
			"    @Description(this.description)\n" +
8828
			"    public void method() {\n" +
8829
			"    }");
8830
	
8831
	this.workingCopies[1] = getWorkingCopy(
8832
			"/Completion/src3/test/Description.java",
8833
			"package test;\n" +
8834
			"public @interface Description {\n" +
8835
			"    String value();\n" +
8836
			"}");
8837
	
8838
	CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
8839
	String str = this.workingCopies[0].getSource();
8840
	String completeBehind = "this.";
8841
	int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
8842
	this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
8843
8844
	assertResults(
8845
			"",
8846
			requestor.getResults());
8847
}
8819
}
8848
}
(-)codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java (-11 / +13 lines)
Lines 999-1016 Link Here
999
999
1000
			this.completionToken = access.token;
1000
			this.completionToken = access.token;
1001
			
1001
			
1002
			if (!this.requestor.isIgnored(CompletionProposal.KEYWORD)) {
1002
			if (!access.isInsideAnnotation) {
1003
				findKeywords(this.completionToken, new char[][]{Keywords.NEW}, false);
1003
				if (!this.requestor.isIgnored(CompletionProposal.KEYWORD)) {
1004
					findKeywords(this.completionToken, new char[][]{Keywords.NEW}, false);
1005
				}
1006
				
1007
				findFieldsAndMethods(
1008
					this.completionToken,
1009
					((TypeBinding) qualifiedBinding).capture(scope, access.receiver.sourceEnd),
1010
					scope,
1011
					access,
1012
					scope,
1013
					false,
1014
					access.receiver instanceof SuperReference);
1004
			}
1015
			}
1005
			
1006
			findFieldsAndMethods(
1007
				this.completionToken,
1008
				((TypeBinding) qualifiedBinding).capture(scope, access.receiver.sourceEnd),
1009
				scope,
1010
				access,
1011
				scope,
1012
				false,
1013
				access.receiver instanceof SuperReference);
1014
1016
1015
		} else if (astNode instanceof CompletionOnMessageSend) {
1017
		} else if (astNode instanceof CompletionOnMessageSend) {
1016
			setSourceRange(astNode.sourceStart, astNode.sourceEnd, false);
1018
			setSourceRange(astNode.sourceStart, astNode.sourceEnd, false);
(-)codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMemberAccess.java (-1 / +4 lines)
Lines 37-45 Link Here
37
37
38
public class CompletionOnMemberAccess extends FieldReference {
38
public class CompletionOnMemberAccess extends FieldReference {
39
	
39
	
40
	public CompletionOnMemberAccess(char[] source, long pos) {
40
	public boolean isInsideAnnotation;
41
	
42
	public CompletionOnMemberAccess(char[] source, long pos, boolean isInsideAnnotation) {
41
		
43
		
42
		super(source, pos);
44
		super(source, pos);
45
		this.isInsideAnnotation = isInsideAnnotation;
43
	}
46
	}
44
	
47
	
45
	public StringBuffer printExpression(int indent, StringBuffer output) {
48
	public StringBuffer printExpression(int indent, StringBuffer output) {
(-)codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java (-1 / +1 lines)
Lines 3611-3617 Link Here
3611
private void pushCompletionOnMemberAccessOnExpressionStack(boolean isSuperAccess) {
3611
private void pushCompletionOnMemberAccessOnExpressionStack(boolean isSuperAccess) {
3612
	char[] source = identifierStack[identifierPtr];
3612
	char[] source = identifierStack[identifierPtr];
3613
	long pos = identifierPositionStack[identifierPtr--];
3613
	long pos = identifierPositionStack[identifierPtr--];
3614
	CompletionOnMemberAccess fr = new CompletionOnMemberAccess(source, pos);
3614
	CompletionOnMemberAccess fr = new CompletionOnMemberAccess(source, pos, isInsideAnnotation());
3615
	this.assistNode = fr;
3615
	this.assistNode = fr;
3616
	this.lastCheckPoint = fr.sourceEnd + 1;
3616
	this.lastCheckPoint = fr.sourceEnd + 1;
3617
	identifierLengthPtr--;
3617
	identifierLengthPtr--;

Return to bug 154993