Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 49489 Details for
Bug 129983
[1.5][assist] Need partial word for annotation autocompletion
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
bug129983_005.txt (text/plain), 24.48 KB, created by
David Audel
on 2006-09-06 10:43:40 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
David Audel
Created:
2006-09-06 10:43:40 EDT
Size:
24.48 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/SearchableEnvironment.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SearchableEnvironment.java,v >retrieving revision 1.65 >diff -u -r1.65 SearchableEnvironment.java >--- model/org/eclipse/jdt/internal/core/SearchableEnvironment.java 22 Jun 2006 14:12:26 -0000 1.65 >+++ model/org/eclipse/jdt/internal/core/SearchableEnvironment.java 6 Sep 2006 14:44:07 -0000 >@@ -67,6 +67,24 @@ > this(project, owner == null ? null : JavaModelManager.getJavaModelManager().getWorkingCopies(owner, true/*add primary WCs*/)); > } > >+ private static int convertSearchFilterToModelFilter(int searchFilter) { >+ switch (searchFilter) { >+ case IJavaSearchConstants.CLASS: >+ return NameLookup.ACCEPT_CLASSES; >+ case IJavaSearchConstants.INTERFACE: >+ return NameLookup.ACCEPT_INTERFACES; >+ case IJavaSearchConstants.ENUM: >+ return NameLookup.ACCEPT_ENUMS; >+ case IJavaSearchConstants.ANNOTATION_TYPE: >+ return NameLookup.ACCEPT_ANNOTATIONS; >+ case IJavaSearchConstants.CLASS_AND_ENUM: >+ return NameLookup.ACCEPT_CLASSES | NameLookup.ACCEPT_ENUMS; >+ case IJavaSearchConstants.CLASS_AND_INTERFACE: >+ return NameLookup.ACCEPT_CLASSES | NameLookup.ACCEPT_INTERFACES; >+ default: >+ return NameLookup.ACCEPT_ALL; >+ } >+ } > /** > * Returns the given type in the the given package if it exists, > * otherwise <code>null</code>. >@@ -166,7 +184,7 @@ > } > > /** >- * Find the top-level types (classes and interfaces) that are defined >+ * Find the top-level types that are defined > * in the current environment and whose name starts with the > * given prefix. The prefix is a qualified name separated by periods > * or a simple name (ex. java.util.V or V). >@@ -180,7 +198,7 @@ > * This method can not be used to find member types... member > * types are found relative to their enclosing type. > */ >- public void findTypes(char[] prefix, final boolean findMembers, boolean camelCaseMatch, final ISearchRequestor storage) { >+ public void findTypes(char[] prefix, final boolean findMembers, boolean camelCaseMatch, int searchFor, final ISearchRequestor storage) { > > /* > if (true){ >@@ -196,7 +214,7 @@ > findTypes( > new String(prefix), > storage, >- NameLookup.ACCEPT_ALL); >+ convertSearchFilterToModelFilter(searchFor)); > return; > } > excludePath = ((IJavaElement) this.unitToSkip).getPath().toString(); >@@ -265,9 +283,9 @@ > new BasicSearchEngine(this.workingCopies).searchAllTypeNames( > qualification, > SearchPattern.R_EXACT_MATCH, >- simpleName, >+ simpleName.length == 0 ? null : simpleName, //TODO(david) remove once bug 156340 will be fixed > matchRule, // not case sensitive >- IJavaSearchConstants.TYPE, >+ searchFor, > this.searchScope, > typeRequestor, > CANCEL_IF_NOT_READY_TO_SEARCH, >@@ -276,13 +294,13 @@ > findTypes( > new String(prefix), > storage, >- NameLookup.ACCEPT_ALL); >+ convertSearchFilterToModelFilter(searchFor)); > } > } catch (JavaModelException e) { > findTypes( > new String(prefix), > storage, >- NameLookup.ACCEPT_ALL); >+ convertSearchFilterToModelFilter(searchFor)); > } > } > >Index: model/org/eclipse/jdt/internal/core/CancelableNameEnvironment.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CancelableNameEnvironment.java,v >retrieving revision 1.7 >diff -u -r1.7 CancelableNameEnvironment.java >--- model/org/eclipse/jdt/internal/core/CancelableNameEnvironment.java 10 May 2006 18:03:47 -0000 1.7 >+++ model/org/eclipse/jdt/internal/core/CancelableNameEnvironment.java 6 Sep 2006 14:44:07 -0000 >@@ -50,8 +50,8 @@ > return super.findType(compoundTypeName); > } > >- public void findTypes(char[] prefix, boolean findMembers, boolean camelCaseMatch, ISearchRequestor storage) { >+ public void findTypes(char[] prefix, boolean findMembers, boolean camelCaseMatch, int searchFor, ISearchRequestor storage) { > checkCanceled(); >- super.findTypes(prefix, findMembers, camelCaseMatch, storage); >+ super.findTypes(prefix, findMembers, camelCaseMatch, searchFor, storage); > } > } >Index: codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java,v >retrieving revision 1.128 >diff -u -r1.128 SelectionEngine.java >--- codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java 24 Apr 2006 15:04:29 -0000 1.128 >+++ codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java 6 Sep 2006 14:44:07 -0000 >@@ -15,6 +15,7 @@ > > import org.eclipse.jdt.core.Signature; > import org.eclipse.jdt.core.compiler.*; >+import org.eclipse.jdt.core.search.IJavaSearchConstants; > import org.eclipse.jdt.internal.codeassist.impl.*; > import org.eclipse.jdt.internal.codeassist.select.*; > import org.eclipse.jdt.internal.compiler.*; >@@ -613,7 +614,7 @@ > char[][] tokens = ((SelectionOnImportReference) importReference).tokens; > this.noProposal = false; > this.requestor.acceptPackage(CharOperation.concatWith(tokens, '.')); >- this.nameEnvironment.findTypes(CharOperation.concatWith(tokens, '.'), false, false,this); >+ this.nameEnvironment.findTypes(CharOperation.concatWith(tokens, '.'), false, false, IJavaSearchConstants.TYPE, this); > > this.lookupEnvironment.buildTypeBindings(parsedUnit, null /*no access restriction*/); > if ((this.unitScope = parsedUnit.scope) != null) { >@@ -638,7 +639,7 @@ > if(!this.acceptedAnswer) { > acceptQualifiedTypes(); > if (!this.acceptedAnswer) { >- this.nameEnvironment.findTypes(this.selectedIdentifier, false, false,this); >+ this.nameEnvironment.findTypes(this.selectedIdentifier, false, false, IJavaSearchConstants.TYPE, this); > // try with simple type name > if(!this.acceptedAnswer) { > acceptQualifiedTypes(); >@@ -687,7 +688,7 @@ > // only reaches here if no selection could be derived from the parsed tree > // thus use the selected source and perform a textual type search > if (!this.acceptedAnswer) { >- this.nameEnvironment.findTypes(this.selectedIdentifier, false, false,this); >+ this.nameEnvironment.findTypes(this.selectedIdentifier, false, false, IJavaSearchConstants.TYPE, this); > > // accept qualified types only if no unqualified type was accepted > if(!this.acceptedAnswer) { >@@ -1120,7 +1121,7 @@ > // thus use the selected source and perform a textual type search > if (!this.acceptedAnswer && searchInEnvironment) { > if (this.selectedIdentifier != null) { >- this.nameEnvironment.findTypes(typeName, false, false,this); >+ this.nameEnvironment.findTypes(typeName, false, false, IJavaSearchConstants.TYPE, this); > > // accept qualified types only if no unqualified type was accepted > if(!this.acceptedAnswer) { >Index: codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java,v >retrieving revision 1.297 >diff -u -r1.297 CompletionEngine.java >--- codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 6 Sep 2006 08:32:21 -0000 1.297 >+++ codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 6 Sep 2006 14:44:06 -0000 >@@ -26,6 +26,7 @@ > import org.eclipse.jdt.core.compiler.CategorizedProblem; > import org.eclipse.jdt.core.compiler.CharOperation; > import org.eclipse.jdt.core.compiler.IProblem; >+import org.eclipse.jdt.core.search.IJavaSearchConstants; > > import org.eclipse.jdt.internal.codeassist.complete.*; > import org.eclipse.jdt.internal.codeassist.impl.AssistParser; >@@ -561,12 +562,9 @@ > } > > private void proposeType(char[] packageName, char[] simpleTypeName, int modifiers, int accessibility, char[] typeName, char[] fullyQualifiedName, boolean isQualified) { >- if(this.assistNodeIsClass) { >- if((modifiers & (ClassFileConstants.AccInterface | ClassFileConstants.AccAnnotation | ClassFileConstants.AccEnum)) != 0 ) return; >- } else if(this.assistNodeIsInterface) { >+ if(this.assistNodeIsInterface) { >+ //TODO(david) remove this code once bug 157177 will be fixed. > if((modifiers & (ClassFileConstants.AccInterface | ClassFileConstants.AccAnnotation)) == 0) return; >- } else if (this.assistNodeIsAnnotation) { >- if((modifiers & ClassFileConstants.AccAnnotation) == 0) return; > } > > char[] completionName = fullyQualifiedName; >@@ -2833,6 +2831,7 @@ > importName, > findMembers, > this.options.camelCaseMatch, >+ IJavaSearchConstants.TYPE, > this); > acceptTypes(); > } >@@ -5094,7 +5093,8 @@ > this.findTypesFromStaticImports(token, scope, proposeAllMemberTypes, typesFound); > } > >- if (token.length == 0) { >+ boolean isEmptyPrefix = token.length == 0; >+ if (isEmptyPrefix && !this.assistNodeIsAnnotation) { > if(proposeType && this.expectedTypesPtr > -1) { > next : for (int i = 0; i <= this.expectedTypesPtr; i++) { > if(this.expectedTypes[i] instanceof ReferenceBinding) { >@@ -5194,7 +5194,7 @@ > } > } > } else { >- if(!this.requestor.isIgnored(CompletionProposal.KEYWORD)) { >+ if(!isEmptyPrefix && !this.requestor.isIgnored(CompletionProposal.KEYWORD)) { > if (this.assistNodeInJavadoc == 0 || (this.assistNodeInJavadoc & CompletionOnJavadoc.BASE_TYPES) != 0) { > findKeywords(token, BASE_TYPE_NAMES, false, false); > } >@@ -5210,14 +5210,27 @@ > '.'); > this.knownTypes.put(fullyQualifiedTypeName, this); > } >+ int searchFor = IJavaSearchConstants.TYPE; >+ if(this.assistNodeIsClass) { >+ searchFor = IJavaSearchConstants.CLASS; >+ } else if(this.assistNodeIsInterface) { >+ //TODO(david) update this code once bug 157177 will be fixed. >+ //searchFor = IJavaSearchConstants.INTERFACE; >+ searchFor = IJavaSearchConstants.TYPE; >+ } else if(this.assistNodeIsEnum) { >+ searchFor = IJavaSearchConstants.ENUM; >+ } else if(this.assistNodeIsAnnotation) { >+ searchFor = IJavaSearchConstants.ANNOTATION_TYPE; >+ } > this.nameEnvironment.findTypes( > token, > proposeAllMemberTypes, > this.options.camelCaseMatch, >+ searchFor, > this); > acceptTypes(); > } >- if(!this.requestor.isIgnored(CompletionProposal.PACKAGE_REF)) { >+ if(!isEmptyPrefix && !this.requestor.isIgnored(CompletionProposal.PACKAGE_REF)) { > this.nameEnvironment.findPackages(token, this); > } > } >@@ -5315,10 +5328,23 @@ > } > > if(proposeType) { >+ int searchFor = IJavaSearchConstants.TYPE; >+ if(this.assistNodeIsClass) { >+ searchFor = IJavaSearchConstants.CLASS; >+ } else if(this.assistNodeIsInterface) { >+ //TODO(david) update this code once bug 157177 will be fixed. >+ //searchFor = IJavaSearchConstants.INTERFACE; >+ searchFor = IJavaSearchConstants.TYPE; >+ } else if(this.assistNodeIsEnum) { >+ searchFor = IJavaSearchConstants.ENUM; >+ } else if(this.assistNodeIsAnnotation) { >+ searchFor = IJavaSearchConstants.ANNOTATION_TYPE; >+ } > this.nameEnvironment.findTypes( > qualifiedName, > false, > this.options.camelCaseMatch, >+ searchFor, > this); > acceptTypes(); > } >#P org.eclipse.jdt.core.tests.model >Index: workspace/Completion/src3/pkgannotation/QQAnnotation.java >=================================================================== >RCS file: workspace/Completion/src3/pkgannotation/QQAnnotation.java >diff -N workspace/Completion/src3/pkgannotation/QQAnnotation.java >--- workspace/Completion/src3/pkgannotation/QQAnnotation.java 10 Dec 2004 14:14:24 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,4 +0,0 @@ >-package pkgannotations; >-@interface QQAnnotation { >- >-} >\ No newline at end of file >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.72 >diff -u -r1.72 CompletionTests_1_5.java >--- src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java 6 Sep 2006 08:32:44 -0000 1.72 >+++ src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java 6 Sep 2006 14:44:15 -0000 >@@ -2091,61 +2091,81 @@ > } > } > public void test0075() throws JavaModelException { >- this.wc = getWorkingCopy( >+ this.workingCopies = new ICompilationUnit[2]; >+ this.workingCopies[0] = getWorkingCopy( > "/Completion/src3/test0075/Test.java", > "package test0075;\n" + > "public @QQAnnot class Test {\n" + > "}"); > >- >+ this.workingCopies[1] = getWorkingCopy( >+ "/Completion/src/pkgannotations/QQAnnotation.java", >+ "package pkgannotations;"+ >+ "public @interface QQAnnotation {\n"+ >+ "}"); >+ > CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); >- String str = this.wc.getSource(); >+ String str = this.workingCopies[0].getSource(); > String completeBehind = "@QQAnnot"; > int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >- this.wc.codeComplete(cursorLocation, requestor); >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); > > assertResults( > "QQAnnotation[TYPE_REF]{pkgannotations.QQAnnotation, pkgannotations, Lpkgannotations.QQAnnotation;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_ANNOTATION + R_NON_RESTRICTED) + "}", > requestor.getResults()); > } >-public void test0076() throws JavaModelException { >- this.wc = getWorkingCopy( >+public void test0076() throws JavaModelException { >+ this.workingCopies = new ICompilationUnit[2]; >+ this.workingCopies[0] = getWorkingCopy( > "/Completion/src3/test0076/Test.java", > "package test0076;\n" + > "public @QQAnnot class Test\n" + > ""); > >+ this.workingCopies[1] = getWorkingCopy( >+ "/Completion/src/pkgannotations/QQAnnotation.java", >+ "package pkgannotations;"+ >+ "public @interface QQAnnotation {\n"+ >+ "}"); > > CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); >- String str = this.wc.getSource(); >+ String str = this.workingCopies[0].getSource(); > String completeBehind = "@QQAnnot"; > int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >- this.wc.codeComplete(cursorLocation, requestor); >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); > > assertResults( > "QQAnnotation[TYPE_REF]{pkgannotations.QQAnnotation, pkgannotations, Lpkgannotations.QQAnnotation;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_ANNOTATION + R_NON_RESTRICTED) + "}", > requestor.getResults()); > } > public void test0077() throws JavaModelException { >- this.wc = getWorkingCopy( >+ this.workingCopies = new ICompilationUnit[2]; >+ this.workingCopies[0] = getWorkingCopy( > "/Completion/src3/test0077/Test.java", > "package test0077;\n" + > "public @QQAnnot\n" + > ""); > >+ this.workingCopies[1] = getWorkingCopy( >+ "/Completion/src/pkgannotations/QQAnnotation.java", >+ "package pkgannotations;"+ >+ "public @interface QQAnnotation {\n"+ >+ "}"); >+ > > CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); >- String str = this.wc.getSource(); >+ String str = this.workingCopies[0].getSource(); > String completeBehind = "@QQAnnot"; > int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >- this.wc.codeComplete(cursorLocation, requestor); >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); > > assertResults( > "QQAnnotation[TYPE_REF]{pkgannotations.QQAnnotation, pkgannotations, Lpkgannotations.QQAnnotation;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_ANNOTATION + R_NON_RESTRICTED) + "}", > requestor.getResults()); > } > public void test0078() throws JavaModelException { >- this.wc = getWorkingCopy( >+ this.workingCopies = new ICompilationUnit[2]; >+ this.workingCopies[0] = getWorkingCopy( > "/Completion/src3/test0078/Test.java", > "package test0078;\n" + > "public class Test {\n" + >@@ -2153,107 +2173,144 @@ > " }\n" + > "}"); > >+ this.workingCopies[1] = getWorkingCopy( >+ "/Completion/src/pkgannotations/QQAnnotation.java", >+ "package pkgannotations;"+ >+ "public @interface QQAnnotation {\n"+ >+ "}"); > > CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); >- String str = this.wc.getSource(); >+ String str = this.workingCopies[0].getSource(); > String completeBehind = "@QQAnnot"; > int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >- this.wc.codeComplete(cursorLocation, requestor); >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); > > assertResults( > "QQAnnotation[TYPE_REF]{pkgannotations.QQAnnotation, pkgannotations, Lpkgannotations.QQAnnotation;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_ANNOTATION + R_NON_RESTRICTED) + "}", > requestor.getResults()); > } > public void test0079() throws JavaModelException { >- this.wc = getWorkingCopy( >+ this.workingCopies = new ICompilationUnit[2]; >+ this.workingCopies[0] = getWorkingCopy( > "/Completion/src3/test0078/Test.java", > "package test0078;\n" + > "public class Test {\n" + > " public @QQAnnot void foo(\n" + > "}"); > >+ this.workingCopies[1] = getWorkingCopy( >+ "/Completion/src/pkgannotations/QQAnnotation.java", >+ "package pkgannotations;"+ >+ "public @interface QQAnnotation {\n"+ >+ "}"); > > CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); >- String str = this.wc.getSource(); >+ String str = this.workingCopies[0].getSource(); > String completeBehind = "@QQAnnot"; > int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >- this.wc.codeComplete(cursorLocation, requestor); >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); > > assertResults( > "QQAnnotation[TYPE_REF]{pkgannotations.QQAnnotation, pkgannotations, Lpkgannotations.QQAnnotation;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_ANNOTATION + R_NON_RESTRICTED) + "}", > requestor.getResults()); > } > public void test0080() throws JavaModelException { >- this.wc = getWorkingCopy( >+ this.workingCopies = new ICompilationUnit[2]; >+ this.workingCopies[0] = getWorkingCopy( > "/Completion/src3/test0078/Test.java", > "package test0078;\n" + > "public class Test {\n" + > " public @QQAnnot int var;\n" + > "}"); > >+ this.workingCopies[1] = getWorkingCopy( >+ "/Completion/src/pkgannotations/QQAnnotation.java", >+ "package pkgannotations;"+ >+ "public @interface QQAnnotation {\n"+ >+ "}"); > > CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); >- String str = this.wc.getSource(); >+ String str = this.workingCopies[0].getSource(); > String completeBehind = "@QQAnnot"; > int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >- this.wc.codeComplete(cursorLocation, requestor); >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); > > assertResults( > "QQAnnotation[TYPE_REF]{pkgannotations.QQAnnotation, pkgannotations, Lpkgannotations.QQAnnotation;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_ANNOTATION + R_NON_RESTRICTED) + "}", > requestor.getResults()); > } > public void test0081() throws JavaModelException { >- this.wc = getWorkingCopy( >+ this.workingCopies = new ICompilationUnit[2]; >+ this.workingCopies[0] = getWorkingCopy( > "/Completion/src3/test0078/Test.java", > "package test0078;\n" + > "public class Test {\n" + > " public @QQAnnot int var\n" + > "}"); > >+ this.workingCopies[1] = getWorkingCopy( >+ "/Completion/src/pkgannotations/QQAnnotation.java", >+ "package pkgannotations;"+ >+ "public @interface QQAnnotation {\n"+ >+ "}"); > > CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); >- String str = this.wc.getSource(); >+ String str = this.workingCopies[0].getSource(); > String completeBehind = "@QQAnnot"; > int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >- this.wc.codeComplete(cursorLocation, requestor); >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); > > assertResults( > "QQAnnotation[TYPE_REF]{pkgannotations.QQAnnotation, pkgannotations, Lpkgannotations.QQAnnotation;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_ANNOTATION + R_NON_RESTRICTED) + "}", > requestor.getResults()); > } > public void test0082() throws JavaModelException { >- this.wc = getWorkingCopy( >+ this.workingCopies = new ICompilationUnit[2]; >+ this.workingCopies[0] = getWorkingCopy( > "/Completion/src3/test0078/Test.java", > "package test0078;\n" + > "public class Test {\n" + > " void foo(@QQAnnot int i) {}\n" + > "}"); > >+ this.workingCopies[1] = getWorkingCopy( >+ "/Completion/src/pkgannotations/QQAnnotation.java", >+ "package pkgannotations;"+ >+ "public @interface QQAnnotation {\n"+ >+ "}"); >+ > > CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); >- String str = this.wc.getSource(); >+ String str = this.workingCopies[0].getSource(); > String completeBehind = "@QQAnnot"; > int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >- this.wc.codeComplete(cursorLocation, requestor); >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); > > assertResults( > "QQAnnotation[TYPE_REF]{pkgannotations.QQAnnotation, pkgannotations, Lpkgannotations.QQAnnotation;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_ANNOTATION + R_NON_RESTRICTED) + "}", > requestor.getResults()); > } > public void test0083() throws JavaModelException { >- this.wc = getWorkingCopy( >+ this.workingCopies = new ICompilationUnit[2]; >+ this.workingCopies[0] = getWorkingCopy( > "/Completion/src3/test0078/Test.java", > "package test0078;\n" + > "public class Test {\n" + > " void foo() {@QQAnnot int i}\n" + > "}"); > >+ this.workingCopies[1] = getWorkingCopy( >+ "/Completion/src/pkgannotations/QQAnnotation.java", >+ "package pkgannotations;"+ >+ "public @interface QQAnnotation {\n"+ >+ "}"); >+ > > CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); >- String str = this.wc.getSource(); >+ String str = this.workingCopies[0].getSource(); > String completeBehind = "@QQAnnot"; > int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >- this.wc.codeComplete(cursorLocation, requestor); >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); > > assertResults( > "QQAnnotation[TYPE_REF]{pkgannotations.QQAnnotation, pkgannotations, Lpkgannotations.QQAnnotation;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_ANNOTATION + R_NON_RESTRICTED) + "}", >@@ -8926,6 +8983,33 @@ > "test0.test1[PACKAGE_REF]{test0.test1., test0.test1, null, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}", > requestor.getResults()); > } >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=129983 >+public void test0290() throws JavaModelException { >+ this.workingCopies = new ICompilationUnit[2]; >+ this.workingCopies[0] = getWorkingCopy( >+ "/Completion/src3/test0290/Test.java", >+ "package test0290;\n" + >+ "@\n" + >+ "public class Test {\n" + >+ "}"); >+ >+ this.workingCopies[1] = getWorkingCopy( >+ "/Completion/src/pkgannotations/QQAnnotation.java", >+ "package pkgannotations;"+ >+ "public @interface QQAnnotation {\n"+ >+ "}"); >+ >+ >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); >+ String str = this.workingCopies[0].getSource(); >+ String completeBehind = "@"; >+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); >+ >+ assertResults( >+ "QQAnnotation[TYPE_REF]{pkgannotations.QQAnnotation, pkgannotations, Lpkgannotations.QQAnnotation;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_ANNOTATION + R_NON_RESTRICTED) + "}", >+ requestor.getResults()); >+} > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=153130 > public void testEC001() throws JavaModelException { > this.workingCopies = new ICompilationUnit[1];
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 129983
: 49489