### Eclipse Workspace Patch 1.0
#P org.eclipse.jdt.core
Index: model/org/eclipse/jdt/core/CompletionRequestor.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/core/CompletionRequestor.java,v
retrieving revision 1.12
diff -u -r1.12 CompletionRequestor.java
--- model/org/eclipse/jdt/core/CompletionRequestor.java 8 Dec 2006 15:05:32 -0000 1.12
+++ model/org/eclipse/jdt/core/CompletionRequestor.java 11 Jan 2007 14:35:39 -0000
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -205,7 +205,11 @@
* It can be a reference to a static method or field (as in a static import)
* e.g. {"java.util.Arrays.equals"}
*
+ * Currently only on demand type references ("java.util.Arrays.*"
),
+ * references to a static method or a static field are used to compute completion proposals.
+ * Other kind of reference could be used in the future.
+ *
+ * The following additional context information is available + * for this kind of completion proposal at little extra cost: + *
+ * The following additional context information is available + * for this kind of completion proposal at little extra cost: + *
+ * The following additional context information is available + * for this kind of completion proposal at little extra cost: + *
null
if none. Lazily computed.
@@ -804,6 +901,56 @@
}
/**
+ * Returns the completion flags relevant in the context, or
+ * CompletionFlags.Default
if none.
+ * + * This field is available for the following kinds of + * completion proposals: + *
FIELD_IMPORT
- completion flags
+ * of the attribute that is referenced. Completion flags for
+ * this proposal kind can only include CompletionFlags.StaticImport
METHOD_IMPORT
- completion flags
+ * of the attribute that is referenced. Completion flags for
+ * this proposal kind can only include CompletionFlags.StaticImport
TYPE_IMPORT
- completion flags
+ * of the attribute that is referenced. Completion flags for
+ * this proposal kind can only include CompletionFlags.StaticImport
CompletionFlags.Default
.
+ *
+ *
+ * @return the completion flags, or
+ * CompletionFlags.Default
if none
+ * @see CompletionFlags
+ *
+ * @since 3.3
+ */
+ public int getAdditionalFlags() {
+ return this.additionalFlags;
+ }
+
+ /**
+ * Sets the completion flags relevant in the context.
+ * + * If not set, defaults to none. + *
+ *+ * The completion engine creates instances of this class and sets + * its properties; this method is not intended to be used by other clients. + *
+ * + * @param additionalFlags the completion flags, or + *CompletionFlags.Default
if none
+ *
+ * @since 3.3
+ */
+ public void setAdditionalFlags(int additionalFlags) {
+ this.additionalFlags = additionalFlags;
+ }
+
+ /**
* Returns the kind of completion being proposed.
* * The set of different kinds of completion proposals is @@ -1057,16 +1204,22 @@ * of the annotation that declares the attribute that is referenced *
ANONYMOUS_CLASS_DECLARATION
- type signature
* of the type that is being subclassed or implementedFIELD_REF
- type signature
+ * FIELD_IMPORT
- type signature
+ * of the type that declares the field that is importedFIELD_REF
- type signature
* of the type that declares the field that is referencedMETHOD_REF
- type signature
+ * METHOD_IMPORT
- type signature
+ * of the type that declares the method that is importedMETHOD_REF
- type signature
* of the type that declares the method that is referencedMETHOD_DECLARATION
- type signature
* of the type that declares the method that is being
* implemented or overriddenPACKAGE_REF
- dot-based package
* name of the package that is referencedTYPE_REF
- dot-based package
+ * TYPE_IMPORT
- dot-based package
+ * name of the package containing the type that is importedTYPE_REF
- dot-based package
* name of the package containing the type that is referencedPOTENTIAL_METHOD_DECLARATION
- type signature
* of the type that declares the method that is being createdANNOTATION_ATTRIBUT_REF
- the name of the attributeFIELD_REF
- the name of the fieldFIELD_IMPORT
- the name of the fieldFIELD_REF
- the name of the fieldKEYWORD
- the keywordLABEL_REF
- the name of the labelLOCAL_VARIABLE_REF
- the name of the local variableMETHOD_REF
- the name of the method (the type simple name for constructor)METHOD_IMPORT
- the name of the methodMETHOD_REF
- the name of the method (the type simple name for constructor)METHOD_DECLARATION
- the name of the method (the type simple name for constructor)VARIABLE_DECLARATION
- the name of the variablePOTENTIAL_METHOD_DECLARATION
- the name of the methodANONYMOUS_CLASS_DECLARATION
- method signature
* of the constructor that is being invokedFIELD_REF
- the type signature
+ * FIELD_IMPORT
- the type signature
+ * of the referenced field's typeFIELD_REF
- the type signature
* of the referenced field's typeLOCAL_VARIABLE_REF
- the type signature
* of the referenced local variable's typeMETHOD_REF
- method signature
+ * METHOD_IMPORT
- method signature
+ * of the method that is importedMETHOD_REF
- method signature
* of the method that is referencedMETHOD_DECLARATION
- method signature
* of the method that is being implemented or overriddenTYPE_IMPORT
- type signature
+ * of the type that is importedTYPE_REF
- type signature
* of the type that is referencedVARIABLE_DECLARATION
- the type signature
@@ -1512,7 +1673,9 @@
* of the attribute that is referenced;
* ANONYMOUS_CLASS_DECLARATION
- modifier flags
* of the constructor that is referencedFIELD_REF
- modifier flags
+ * FIELD_IMPORT
- modifier flags
+ * of the field that is imported.FIELD_REF
- modifier flags
* of the field that is referenced;
* Flags.AccEnum
can be used to recognize
* references to enum constants
@@ -1521,14 +1684,22 @@
* corrresponding to the modifier keywordLOCAL_VARIABLE_REF
- modifier flags
* of the local variable that is referencedMETHOD_IMPORT
- modifier flags
+ * of the method that is imported;
+ * METHOD_REF
- modifier flags
* of the method that is referenced;
* Flags.AccAnnotation
can be used to recognize
* references to annotation type members
* METHOD_DECLARATION
- modifier flags
+ * METHOD_DECLARATION
- modifier flags
* for the method that is being implemented or overriddenTYPE_REF
- modifier flags
+ * TYPE_IMPORT
- modifier flags
+ * of the type that is imporetd; Flags.AccInterface
+ * can be used to recognize references to interfaces,
+ * Flags.AccEnum
enum types,
+ * and Flags.AccAnnotation
annotation typesTYPE_REF
- modifier flags
* of the type that is referenced; Flags.AccInterface
* can be used to recognize references to interfaces,
* Flags.AccEnum
enum types,
@@ -1580,11 +1751,15 @@
* FIELD_REF
- The allowed required proposals for this kind are:
* TYPE_REF
TYPE_IMPORT
FIELD_IMPORT
METHOD_REF
- The allowed required proposals for this kind are:
* TYPE_REF
TYPE_IMPORT
METHOD_IMPORT
+ * This class provides static methods only; it is not intended to be + * instantiated or subclassed by clients. + *
+ * + * @see CompletionProposal#getAdditionalFlags() + * + * @since 3.3 + */ +public final class CompletionFlags { + /** + * Constant representing the absence of any flag + */ + public static final int Default = 0x0000; + + /** + * Constant representing a static import + */ + public static final int StaticImport = 0x0001; + + /** + * Not instantiable. + */ + private CompletionFlags() { + // Not instantiable + } + + /** + * Returns whether the given integer includes the {@link #StaticImport} flag. + * + * @param flags the flags + * @returntrue
if the {@link #StaticImport} flag is included
+ */
+ public static boolean isStaticImport(int flags) {
+ return (flags & StaticImport) != 0;
+ }
+}
#P org.eclipse.jdt.core.tests.model
Index: src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java,v
retrieving revision 1.19
diff -u -r1.19 CompletionTestsRequestor2.java
--- src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java 16 Oct 2006 17:20:51 -0000 1.19
+++ src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java 11 Jan 2007 14:35:49 -0000
@@ -71,8 +71,8 @@
}
public void allowAllRequiredProposals() {
- for (int i = CompletionProposal.ANONYMOUS_CLASS_DECLARATION; i <= CompletionProposal.JAVADOC_INLINE_TAG; i++) {
- for (int j = CompletionProposal.ANONYMOUS_CLASS_DECLARATION; j <= CompletionProposal.JAVADOC_INLINE_TAG; j++) {
+ for (int i = CompletionProposal.ANONYMOUS_CLASS_DECLARATION; i <= CompletionProposal.TYPE_IMPORT; i++) {
+ for (int j = CompletionProposal.ANONYMOUS_CLASS_DECLARATION; j <= CompletionProposal.TYPE_IMPORT; j++) {
this.setAllowsRequiredProposals(i, j, true);
}
}
@@ -289,6 +289,15 @@
case CompletionProposal.JAVADOC_VALUE_REF :
buffer.append("JAVADOC_VALUE_REF"); //$NON-NLS-1$
break;
+ case CompletionProposal.FIELD_IMPORT :
+ buffer.append("FIELD_IMPORT"); //$NON-NLS-1$
+ break;
+ case CompletionProposal.METHOD_IMPORT :
+ buffer.append("METHOD_IMPORT"); //$NON-NLS-1$
+ break;
+ case CompletionProposal.TYPE_IMPORT :
+ buffer.append("TYPE_IMPORT"); //$NON-NLS-1$
+ break;
default :
buffer.append("PROPOSAL"); //$NON-NLS-1$
break;
@@ -412,6 +421,7 @@
case CompletionProposal.ANONYMOUS_CLASS_DECLARATION :
return new String(Signature.getSignatureSimpleName(proposal.getDeclarationSignature()));
case CompletionProposal.TYPE_REF :
+ case CompletionProposal.TYPE_IMPORT :
case CompletionProposal.JAVADOC_TYPE_REF :
return new String(Signature.getSignatureSimpleName(proposal.getSignature()));
case CompletionProposal.FIELD_REF :
@@ -430,6 +440,8 @@
case CompletionProposal.JAVADOC_METHOD_REF :
case CompletionProposal.JAVADOC_PARAM_REF :
case CompletionProposal.JAVADOC_VALUE_REF :
+ case CompletionProposal.FIELD_IMPORT :
+ case CompletionProposal.METHOD_IMPORT :
return new String(proposal.getName());
case CompletionProposal.PACKAGE_REF:
return new String(proposal.getDeclarationSignature());
Index: src/org/eclipse/jdt/core/tests/model/CompletionTests.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests.java,v
retrieving revision 1.139
diff -u -r1.139 CompletionTests.java
--- src/org/eclipse/jdt/core/tests/model/CompletionTests.java 15 Dec 2006 14:10:50 -0000 1.139
+++ src/org/eclipse/jdt/core/tests/model/CompletionTests.java 11 Jan 2007 14:35:49 -0000
@@ -13397,16 +13397,23 @@
" public static int foo;\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
String str = this.workingCopies[0].getSource();
String completeBehind = "foo";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
+ int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
+ int start1 = str.lastIndexOf("foo") + "".length();
+ int end1 = start1 + "foo".length();
+ int start2 = str.lastIndexOf("public class");
+ int end2 = start2 + "".length();
assertResults(
- "foo[FIELD_REF]{test.p.ZZZ.foo, Ltest.p.ZZZ;, I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}",
+ "foo[FIELD_REF]{ZZZ.foo, Ltest.p.ZZZ;, I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
+ " ZZZ[TYPE_IMPORT]{import test.p.ZZZ;\n, test.p, Ltest.p.ZZZ;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
@@ -13428,7 +13435,8 @@
" public static int foo(){}\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
String str = this.workingCopies[0].getSource();
@@ -13436,8 +13444,14 @@
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+ int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
+ int start1 = str.lastIndexOf("foo") + "".length();
+ int end1 = start1 + "foo".length();
+ int start2 = str.lastIndexOf("public class");
+ int end2 = start2 + "".length();
assertResults(
- "foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}",
+ "foo[METHOD_REF]{ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
+ " ZZZ[TYPE_IMPORT]{import test.p.ZZZ;\n, test.p, Ltest.p.ZZZ;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
@@ -13459,7 +13473,8 @@
" public static int foo;\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ"});
String str = this.workingCopies[0].getSource();
@@ -13490,7 +13505,8 @@
" public static int foo(){}\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ"});
String str = this.workingCopies[0].getSource();
@@ -13521,7 +13537,8 @@
" public static int foo;\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"});
String str = this.workingCopies[0].getSource();
@@ -13529,8 +13546,14 @@
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+ int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
+ int start1 = str.lastIndexOf("foo") + "".length();
+ int end1 = start1 + "foo".length();
+ int start2 = str.lastIndexOf("public class");
+ int end2 = start2 + "".length();
assertResults(
- "",
+ "foo[FIELD_REF]{ZZZ.foo, Ltest.p.ZZZ;, I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
+ " ZZZ[TYPE_IMPORT]{import test.p.ZZZ;\n, test.p, Ltest.p.ZZZ;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
@@ -13552,7 +13575,8 @@
" public static int foo(){}\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"});
String str = this.workingCopies[0].getSource();
@@ -13560,8 +13584,14 @@
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+ int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
+ int start1 = str.lastIndexOf("foo") + "".length();
+ int end1 = start1 + "foo".length();
+ int start2 = str.lastIndexOf("public class");
+ int end2 = start2 + "".length();
assertResults(
- "",
+ "foo[METHOD_REF]{ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
+ " ZZZ[TYPE_IMPORT]{import test.p.ZZZ;\n, test.p, Ltest.p.ZZZ;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
@@ -13584,7 +13614,8 @@
" public static int foo(){}\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
String str = this.workingCopies[0].getSource();
@@ -13592,8 +13623,14 @@
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+ int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
+ int start1 = str.lastIndexOf("foo") + "".length();
+ int end1 = start1 + "foo".length();
+ int start2 = str.lastIndexOf("public class");
+ int end2 = start2 + "".length();
assertResults(
- "foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}",
+ "foo[METHOD_REF]{ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
+ " ZZZ[TYPE_IMPORT]{import test.p.ZZZ;\n, test.p, Ltest.p.ZZZ;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
@@ -13616,7 +13653,8 @@
" public static int foo(){}\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"});
String str = this.workingCopies[0].getSource();
@@ -13624,8 +13662,14 @@
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+ int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
+ int start1 = str.lastIndexOf("foo") + "".length();
+ int end1 = start1 + "foo".length();
+ int start2 = str.lastIndexOf("public class");
+ int end2 = start2 + "".length();
assertResults(
- "",
+ "foo[METHOD_REF]{ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
+ " ZZZ[TYPE_IMPORT]{import test.p.ZZZ;\n, test.p, Ltest.p.ZZZ;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
@@ -13648,7 +13692,8 @@
" public static int foo(){}\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
String str = this.workingCopies[0].getSource();
@@ -13656,8 +13701,14 @@
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+ int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
+ int start1 = str.lastIndexOf("foo") + "".length();
+ int end1 = start1 + "foo".length();
+ int start2 = str.lastIndexOf("public class");
+ int end2 = start2 + "".length();
assertResults(
- "foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}",
+ "foo[METHOD_REF]{ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
+ " ZZZ[TYPE_IMPORT]{import test.p.ZZZ;\n, test.p, Ltest.p.ZZZ;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
@@ -13680,7 +13731,8 @@
" public static int foo(){}\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"});
String str = this.workingCopies[0].getSource();
@@ -13688,8 +13740,14 @@
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+ int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
+ int start1 = str.lastIndexOf("foo") + "".length();
+ int end1 = start1 + "foo".length();
+ int start2 = str.lastIndexOf("public class");
+ int end2 = start2 + "".length();
assertResults(
- "",
+ "foo[METHOD_REF]{ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
+ " ZZZ[TYPE_IMPORT]{import test.p.ZZZ;\n, test.p, Ltest.p.ZZZ;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
@@ -13713,17 +13771,24 @@
" public static int foo(){}\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
String str = this.workingCopies[0].getSource();
String completeBehind = "foo";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED) + "}\n" +
- "Test.foo[TYPE_REF]{foo, test, Ltest.Test$foo;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
+
+ int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
+ int start1 = str.lastIndexOf("foo") + "".length();
+ int end1 = start1 + "foo".length();
+ int start2 = str.lastIndexOf("public class Test");
+ int end2 = start2 + "".length();
+ assertResults(
+ "foo[METHOD_REF]{ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
+ " ZZZ[TYPE_IMPORT]{import test.p.ZZZ;\n, test.p, Ltest.p.ZZZ;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}\n"+
+ "Test.foo[TYPE_REF]{foo, test, Ltest.Test$foo;, null, null, ["+start1+", "+end1+"], "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
@@ -13745,7 +13810,8 @@
" public static int foo(){}\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
String str = this.workingCopies[0].getSource();
@@ -13753,9 +13819,10 @@
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+ int start1 = str.lastIndexOf("foo") + "".length();
+ int end1 = start1 + "foo".length();
assertResults(
- "foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED) + "}\n" +
- "foo[METHOD_REF]{foo(), Ltest.Test;, ()V, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
+ "foo[METHOD_REF]{foo(), Ltest.Test;, ()V, foo, null, ["+start1+", "+end1+"], "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
@@ -13778,7 +13845,8 @@
" public static int foo(){}\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
String str = this.workingCopies[0].getSource();
@@ -13786,9 +13854,15 @@
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
- assertResults(
- "foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED) + "}\n" +
- "foo[FIELD_REF]{foo, Ltest.Test;, I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
+ int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
+ int start1 = str.lastIndexOf("foo") + "".length();
+ int end1 = start1 + "foo".length();
+ int start2 = str.lastIndexOf("public class Test");
+ int end2 = start2 + "".length();
+ assertResults(
+ "foo[METHOD_REF]{ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
+ " ZZZ[TYPE_IMPORT]{import test.p.ZZZ;\n, test.p, Ltest.p.ZZZ;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}\n"+
+ "foo[FIELD_REF]{foo, Ltest.Test;, I, foo, null, ["+start1+", "+end1+"], "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
@@ -13811,7 +13885,8 @@
" public static int foo(){}\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
String str = this.workingCopies[0].getSource();
@@ -13819,9 +13894,15 @@
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
- assertResults(
- "foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED) + "}\n" +
- "foo[LOCAL_VARIABLE_REF]{foo, null, I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
+ int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
+ int start1 = str.lastIndexOf("foo") + "".length();
+ int end1 = start1 + "foo".length();
+ int start2 = str.lastIndexOf("public class Test");
+ int end2 = start2 + "".length();
+ assertResults(
+ "foo[METHOD_REF]{ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
+ " ZZZ[TYPE_IMPORT]{import test.p.ZZZ;\n, test.p, Ltest.p.ZZZ;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}\n"+
+ "foo[LOCAL_VARIABLE_REF]{foo, null, I, foo, null, ["+start1+", "+end1+"], "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
@@ -13844,7 +13925,8 @@
" public static int foo(int i){}\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
String str = this.workingCopies[0].getSource();
@@ -13852,9 +13934,16 @@
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
- assertResults(
- "foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED) + "}\n" +
- "foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, (I)I, foo, (i), "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}",
+ int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
+ int start1 = str.lastIndexOf("foo") + "".length();
+ int end1 = start1 + "foo".length();
+ int start2 = str.lastIndexOf("public class Test");
+ int end2 = start2 + "".length();
+ assertResults(
+ "foo[METHOD_REF]{ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
+ " ZZZ[TYPE_IMPORT]{import test.p.ZZZ;\n, test.p, Ltest.p.ZZZ;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}\n"+
+ "foo[METHOD_REF]{ZZZ.foo(), Ltest.p.ZZZ;, (I)I, foo, (i), ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
+ " ZZZ[TYPE_IMPORT]{import test.p.ZZZ;\n, test.p, Ltest.p.ZZZ;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
@@ -13876,7 +13965,8 @@
" public static int foo(){}\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
String str = this.workingCopies[0].getSource();
@@ -13888,4 +13978,206 @@
"",
requestor.getResults());
}
+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
+public void testFavoriteImports023() throws JavaModelException {
+ this.workingCopies = new ICompilationUnit[2];
+ this.workingCopies[0] = getWorkingCopy(
+ "/Completion/src3/test/Test.java",
+ "package test;\n" +
+ "/** */\n" +
+ "public class Test {\n" +
+ " public void method() {\n" +
+ " foo\n" +
+ " }\n" +
+ "}");
+
+ this.workingCopies[1] = getWorkingCopy(
+ "/Completion/src3/test/p/ZZZ.java",
+ "package test.p;\n" +
+ "public class ZZZ {\n" +
+ " public static int foo;\n" +
+ "}");
+
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
+ requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
+
+ String str = this.workingCopies[0].getSource();
+ String completeBehind = "foo";
+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+
+ int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
+ int start1 = str.lastIndexOf("foo") + "".length();
+ int end1 = start1 + "foo".length();
+ int start2 = str.lastIndexOf("/** */");
+ int end2 = start2 + "".length();
+ assertResults(
+ "foo[FIELD_REF]{ZZZ.foo, Ltest.p.ZZZ;, I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
+ " ZZZ[TYPE_IMPORT]{import test.p.ZZZ;\n, test.p, Ltest.p.ZZZ;, null, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
+ requestor.getResults());
+}
+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
+public void testFavoriteImports024() throws JavaModelException {
+ this.workingCopies = new ICompilationUnit[2];
+ this.workingCopies[0] = getWorkingCopy(
+ "/Completion/src3/test/Test.java",
+ "package test;\n" +
+ "public class Test {\n" +
+ " public void method() {\n" +
+ " foo\n" +
+ " }\n" +
+ "}");
+
+ this.workingCopies[1] = getWorkingCopy(
+ "/Completion/src3/test/p/ZZZ.java",
+ "package test.p;\n" +
+ "public class ZZZ {\n" +
+ " public int foo;\n" +
+ "}");
+
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
+ requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
+
+ String str = this.workingCopies[0].getSource();
+ String completeBehind = "foo";
+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+
+ assertResults(
+ "",
+ requestor.getResults());
+}
+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
+public void testFavoriteImports025() throws JavaModelException {
+ this.workingCopies = new ICompilationUnit[2];
+ this.workingCopies[0] = getWorkingCopy(
+ "/Completion/src3/test/Test.java",
+ "package test;\n" +
+ "public class Test {\n" +
+ " public void method() {\n" +
+ " foo\n" +
+ " }\n" +
+ "}");
+
+ this.workingCopies[1] = getWorkingCopy(
+ "/Completion/src3/test/p/ZZZ.java",
+ "package test.p;\n" +
+ "public class ZZZ {\n" +
+ " public int foo;\n" +
+ "}");
+
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
+ requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"});
+
+ String str = this.workingCopies[0].getSource();
+ String completeBehind = "foo";
+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+
+ assertResults(
+ "",
+ requestor.getResults());
+}
+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
+public void testFavoriteImports026() throws JavaModelException {
+ this.workingCopies = new ICompilationUnit[2];
+ this.workingCopies[0] = getWorkingCopy(
+ "/Completion/src3/test/Test.java",
+ "package test;\n" +
+ "public class Test {\n" +
+ " public void method() {\n" +
+ " foo\n" +
+ " }\n" +
+ "}");
+
+ this.workingCopies[1] = getWorkingCopy(
+ "/Completion/src3/test/p/ZZZ.java",
+ "package test.p;\n" +
+ "public class ZZZ {\n" +
+ " public int foo(){return 0;};\n" +
+ "}");
+
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
+ requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
+
+ String str = this.workingCopies[0].getSource();
+ String completeBehind = "foo";
+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+
+ assertResults(
+ "",
+ requestor.getResults());
+}
+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
+public void testFavoriteImports027() throws JavaModelException {
+ this.workingCopies = new ICompilationUnit[2];
+ this.workingCopies[0] = getWorkingCopy(
+ "/Completion/src3/test/Test.java",
+ "package test;\n" +
+ "public class Test {\n" +
+ " public void method() {\n" +
+ " foo\n" +
+ " }\n" +
+ "}");
+
+ this.workingCopies[1] = getWorkingCopy(
+ "/Completion/src3/test/p/ZZZ.java",
+ "package test.p;\n" +
+ "public class ZZZ {\n" +
+ " public int foo(){return 0;};\n" +
+ "}");
+
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
+ requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"});
+
+ String str = this.workingCopies[0].getSource();
+ String completeBehind = "foo";
+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+
+ assertResults(
+ "",
+ requestor.getResults());
+}
+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
+public void testFavoriteImports028() throws JavaModelException {
+ this.workingCopies = new ICompilationUnit[2];
+ this.workingCopies[0] = getWorkingCopy(
+ "/Completion/src3/test/Test.java",
+ "package test;\n" +
+ "import test.p.ZZZ;\n" +
+ "public class Test {\n" +
+ " public void method() {\n" +
+ " foo\n" +
+ " }\n" +
+ "}");
+
+ this.workingCopies[1] = getWorkingCopy(
+ "/Completion/src3/test/p/ZZZ.java",
+ "package test.p;\n" +
+ "public class ZZZ {\n" +
+ " public static int foo(){return 0;};\n" +
+ "}");
+
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
+ requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"});
+
+ String str = this.workingCopies[0].getSource();
+ String completeBehind = "foo";
+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+
+ int start1 = str.lastIndexOf("foo") + "".length();
+ int end1 = start1 + "foo".length();
+ assertResults(
+ "foo[METHOD_REF]{ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED) + "}",
+ requestor.getResults());
+}
}
Index: src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java,v
retrieving revision 1.79
diff -u -r1.79 CompletionTests_1_5.java
--- src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java 8 Dec 2006 15:05:58 -0000 1.79
+++ src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java 11 Jan 2007 14:35:51 -0000
@@ -9444,7 +9444,8 @@
" public static int foo;\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
String str = this.workingCopies[0].getSource();
@@ -9452,8 +9453,14 @@
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+ int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
+ int start1 = str.lastIndexOf("foo") + "".length();
+ int end1 = start1 + "foo".length();
+ int start2 = str.lastIndexOf("public class");
+ int end2 = start2 + "".length();
assertResults(
- "foo[FIELD_REF]{test.p.ZZZ.foo, Ltest.p.ZZZ;, I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}",
+ "foo[FIELD_REF]{foo, Ltest.p.ZZZ;, I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
+ " foo[FIELD_IMPORT]{import static test.p.ZZZ.foo;\n, Ltest.p.ZZZ;, I, foo, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
@@ -9475,16 +9482,23 @@
" public static int foo(){}\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
String str = this.workingCopies[0].getSource();
String completeBehind = "foo";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
+ int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
+ int start1 = str.lastIndexOf("foo") + "".length();
+ int end1 = start1 + "foo".length();
+ int start2 = str.lastIndexOf("public class");
+ int end2 = start2 + "".length();
assertResults(
- "foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}",
+ "foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
+ " foo[METHOD_IMPORT]{import static test.p.ZZZ.foo;\n, Ltest.p.ZZZ;, ()I, foo, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
@@ -9506,7 +9520,8 @@
" public static int foo;\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ"});
String str = this.workingCopies[0].getSource();
@@ -9537,7 +9552,8 @@
" public static int foo(){}\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ"});
String str = this.workingCopies[0].getSource();
@@ -9568,16 +9584,23 @@
" public static int foo;\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"});
String str = this.workingCopies[0].getSource();
String completeBehind = "foo";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
+ int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
+ int start1 = str.lastIndexOf("foo") + "".length();
+ int end1 = start1 + "foo".length();
+ int start2 = str.lastIndexOf("public class");
+ int end2 = start2 + "".length();
assertResults(
- "foo[FIELD_REF]{test.p.ZZZ.foo, Ltest.p.ZZZ;, I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}",
+ "foo[FIELD_REF]{foo, Ltest.p.ZZZ;, I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
+ " foo[FIELD_IMPORT]{import static test.p.ZZZ.foo;\n, Ltest.p.ZZZ;, I, foo, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
@@ -9599,7 +9622,8 @@
" public static int foo(){}\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"});
String str = this.workingCopies[0].getSource();
@@ -9607,8 +9631,14 @@
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+ int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
+ int start1 = str.lastIndexOf("foo") + "".length();
+ int end1 = start1 + "foo".length();
+ int start2 = str.lastIndexOf("public class");
+ int end2 = start2 + "".length();
assertResults(
- "foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}",
+ "foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
+ " foo[METHOD_IMPORT]{import static test.p.ZZZ.foo;\n, Ltest.p.ZZZ;, ()I, foo, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
@@ -9631,7 +9661,8 @@
" public static int foo(){}\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
String str = this.workingCopies[0].getSource();
@@ -9639,8 +9670,14 @@
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+ int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
+ int start1 = str.lastIndexOf("foo") + "".length();
+ int end1 = start1 + "foo".length();
+ int start2 = str.lastIndexOf("public class");
+ int end2 = start2 + "".length();
assertResults(
- "foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}",
+ "foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
+ " foo[METHOD_IMPORT]{import static test.p.ZZZ.foo;\n, Ltest.p.ZZZ;, ()I, foo, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
@@ -9663,16 +9700,19 @@
" public static int foo(){}\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
String str = this.workingCopies[0].getSource();
String completeBehind = "foo";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
+
+ int start1 = str.lastIndexOf("foo") + "".length();
+ int end1 = start1 + "foo".length();
assertResults(
- "foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED +R_NON_RESTRICTED)+"}",
+ "foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED +R_NON_RESTRICTED)+"}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
@@ -9695,7 +9735,8 @@
" public static int foo(){}\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"});
String str = this.workingCopies[0].getSource();
@@ -9703,8 +9744,14 @@
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+ int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
+ int start1 = str.lastIndexOf("foo") + "".length();
+ int end1 = start1 + "foo".length();
+ int start2 = str.lastIndexOf("public class");
+ int end2 = start2 + "".length();
assertResults(
- "foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}",
+ "foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
+ " foo[METHOD_IMPORT]{import static test.p.ZZZ.foo;\n, Ltest.p.ZZZ;, ()I, foo, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
@@ -9727,7 +9774,8 @@
" public static int foo(){}\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"});
String str = this.workingCopies[0].getSource();
@@ -9735,8 +9783,10 @@
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+ int start1 = str.lastIndexOf("foo") + "".length();
+ int end1 = start1 + "foo".length();
assertResults(
- "foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
+ "foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED +R_NON_RESTRICTED)+"}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
@@ -9759,7 +9809,8 @@
" public static int foo(){}\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
String str = this.workingCopies[0].getSource();
@@ -9767,8 +9818,14 @@
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+ int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
+ int start1 = str.lastIndexOf("foo") + "".length();
+ int end1 = start1 + "foo".length();
+ int start2 = str.lastIndexOf("public class");
+ int end2 = start2 + "".length();
assertResults(
- "foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}",
+ "foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
+ " foo[METHOD_IMPORT]{import static test.p.ZZZ.foo;\n, Ltest.p.ZZZ;, ()I, foo, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
@@ -9791,7 +9848,8 @@
" public static int foo(){}\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
String str = this.workingCopies[0].getSource();
@@ -9799,8 +9857,10 @@
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+ int start1 = str.lastIndexOf("foo") + "".length();
+ int end1 = start1 + "foo".length();
assertResults(
- "foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
+ "foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED +R_NON_RESTRICTED)+"}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
@@ -9823,7 +9883,8 @@
" public static int foo(){}\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"});
String str = this.workingCopies[0].getSource();
@@ -9831,8 +9892,14 @@
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+ int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
+ int start1 = str.lastIndexOf("foo") + "".length();
+ int end1 = start1 + "foo".length();
+ int start2 = str.lastIndexOf("public class");
+ int end2 = start2 + "".length();
assertResults(
- "foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}",
+ "foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
+ " foo[METHOD_IMPORT]{import static test.p.ZZZ.foo;\n, Ltest.p.ZZZ;, ()I, foo, null, ["+start2+", "+end2+"], " + (relevance1) + "}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
@@ -9855,7 +9922,8 @@
" public static int foo(){}\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"});
String str = this.workingCopies[0].getSource();
@@ -9863,8 +9931,10 @@
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+ int start1 = str.lastIndexOf("foo") + "".length();
+ int end1 = start1 + "foo".length();
assertResults(
- "foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
+ "foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED +R_NON_RESTRICTED)+"}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
@@ -9894,7 +9964,8 @@
" public static int foo(){}\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.q.ZZZ2.foo"});
String str = this.workingCopies[0].getSource();
@@ -9902,9 +9973,10 @@
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+ int start1 = str.lastIndexOf("foo") + "".length();
+ int end1 = start1 + "foo".length();
assertResults(
- "foo[METHOD_REF]{test.q.ZZZ2.foo(), Ltest.q.ZZZ2;, ()I, foo, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED) + "}\n" +
- "foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
+ "foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
@@ -9928,17 +10000,24 @@
" public static int foo(){}\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
String str = this.workingCopies[0].getSource();
String completeBehind = "foo";
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
-
- assertResults(
- "foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED) + "}\n" +
- "Test.foo[TYPE_REF]{foo, test, Ltest.Test$foo;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
+
+ int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
+ int start1 = str.lastIndexOf("foo") + "".length();
+ int end1 = start1 + "foo".length();
+ int start2 = str.lastIndexOf("public class Test");
+ int end2 = start2 + "".length();
+ assertResults(
+ "foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], " + (relevance1) + "}\n" +
+ " foo[METHOD_IMPORT]{import static test.p.ZZZ.foo;\n, Ltest.p.ZZZ;, ()I, foo, null, ["+start2+", "+end2+"], " + (relevance1) + "}\n" +
+ "Test.foo[TYPE_REF]{foo, test, Ltest.Test$foo;, null, null, ["+start1+", "+end1+"], "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
@@ -9960,7 +10039,8 @@
" public static int foo(){}\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
String str = this.workingCopies[0].getSource();
@@ -9968,9 +10048,10 @@
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+ int start1 = str.lastIndexOf("foo") + "".length();
+ int end1 = start1 + "foo".length();
assertResults(
- "foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED) + "}\n" +
- "foo[METHOD_REF]{foo(), Ltest.Test;, ()V, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
+ "foo[METHOD_REF]{foo(), Ltest.Test;, ()V, foo, null, ["+start1+", "+end1+"], "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
@@ -9993,7 +10074,8 @@
" public static int foo(){}\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
String str = this.workingCopies[0].getSource();
@@ -10001,9 +10083,15 @@
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
- assertResults(
- "foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED) + "}\n" +
- "foo[FIELD_REF]{foo, Ltest.Test;, I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
+ int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
+ int start1 = str.lastIndexOf("foo") + "".length();
+ int end1 = start1 + "foo".length();
+ int start2 = str.lastIndexOf("public class");
+ int end2 = start2 + "".length();
+ assertResults(
+ "foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
+ " foo[METHOD_IMPORT]{import static test.p.ZZZ.foo;\n, Ltest.p.ZZZ;, ()I, foo, null, ["+start2+", "+end2+"], " + (relevance1) + "}\n"+
+ "foo[FIELD_REF]{foo, Ltest.Test;, I, foo, null, ["+start1+", "+end1+"], " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
@@ -10026,7 +10114,8 @@
" public static int foo(){}\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"});
String str = this.workingCopies[0].getSource();
@@ -10034,9 +10123,15 @@
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
- assertResults(
- "foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED) + "}\n" +
- "foo[LOCAL_VARIABLE_REF]{foo, null, I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
+ int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
+ int start1 = str.lastIndexOf("foo") + "".length();
+ int end1 = start1 + "foo".length();
+ int start2 = str.lastIndexOf("public class");
+ int end2 = start2 + "".length();
+ assertResults(
+ "foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
+ " foo[METHOD_IMPORT]{import static test.p.ZZZ.foo;\n, Ltest.p.ZZZ;, ()I, foo, null, ["+start2+", "+end2+"], " + (relevance1) + "}\n"+
+ "foo[LOCAL_VARIABLE_REF]{foo, null, I, foo, null, ["+start1+", "+end1+"], "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
@@ -10059,7 +10154,8 @@
" public static int foo(int i){}\n" +
"}");
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true);
+ requestor.allowAllRequiredProposals();
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"});
String str = this.workingCopies[0].getSource();
@@ -10067,9 +10163,16 @@
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
- assertResults(
- "foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED) + "}\n" +
- "foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, (I)I, foo, (i), "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}",
+ int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED;
+ int start1 = str.lastIndexOf("foo") + "".length();
+ int end1 = start1 + "foo".length();
+ int start2 = str.lastIndexOf("public class");
+ int end2 = start2 + "".length();
+ assertResults(
+ "foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
+ " foo[METHOD_IMPORT]{import static test.p.ZZZ.foo;\n, Ltest.p.ZZZ;, ()I, foo, null, ["+start2+", "+end2+"], " + (relevance1) + "}\n"+
+ "foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, (I)I, foo, (i), ["+start1+", "+end1+"], "+(relevance1)+"}\n" +
+ " foo[METHOD_IMPORT]{import static test.p.ZZZ.foo;\n, Ltest.p.ZZZ;, (I)I, foo, (i), ["+start2+", "+end2+"], " + (relevance1) + "}",
requestor.getResults());
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123
@@ -10091,7 +10194,8 @@
" public static