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 80416 Details for
Bug 206336
[assist] CompletionProposal#getTokenStart() return always 0
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
bug206336_001.txt (text/plain), 66.16 KB, created by
David Audel
on 2007-10-16 03:39:32 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
David Audel
Created:
2007-10-16 03:39:32 EDT
Size:
66.16 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >Index: workspace/Completion/src/CompletionBasicPackage1.java >=================================================================== >RCS file: workspace/Completion/src/CompletionBasicPackage1.java >diff -N workspace/Completion/src/CompletionBasicPackage1.java >--- workspace/Completion/src/CompletionBasicPackage1.java 14 Oct 2004 16:02:48 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,3 +0,0 @@ >-public class CompletionBasicPackage1 { >- java.lan >-} >\ No newline at end of file >Index: workspace/Completion/src/CompletionBasicField1.java >=================================================================== >RCS file: workspace/Completion/src/CompletionBasicField1.java >diff -N workspace/Completion/src/CompletionBasicField1.java >--- workspace/Completion/src/CompletionBasicField1.java 14 Oct 2004 16:02:48 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,6 +0,0 @@ >-public class CompletionBasicField1 { >- public int zzvarzz; >- void foo() { >- zzvar >- } >-} >\ No newline at end of file >Index: workspace/Completion/src/CompletionBasicMethodDeclaration1.java >=================================================================== >RCS file: workspace/Completion/src/CompletionBasicMethodDeclaration1.java >diff -N workspace/Completion/src/CompletionBasicMethodDeclaration1.java >--- workspace/Completion/src/CompletionBasicMethodDeclaration1.java 14 Oct 2004 16:02:48 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,3 +0,0 @@ >-public class CompletionBasicMethodDeclaration1 { >- equals >-} >\ No newline at end of file >Index: workspace/Completion/src/CompletionBasicKeyword1.java >=================================================================== >RCS file: workspace/Completion/src/CompletionBasicKeyword1.java >diff -N workspace/Completion/src/CompletionBasicKeyword1.java >--- workspace/Completion/src/CompletionBasicKeyword1.java 14 Oct 2004 16:02:48 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,5 +0,0 @@ >-public class CompletionBasicKeyword1 { >- void foo() { >- whil >- } >-} >\ No newline at end of file >Index: workspace/Completion/src/CompletionBasicMethod1.java >=================================================================== >RCS file: workspace/Completion/src/CompletionBasicMethod1.java >diff -N workspace/Completion/src/CompletionBasicMethod1.java >--- workspace/Completion/src/CompletionBasicMethod1.java 14 Oct 2004 16:02:48 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,5 +0,0 @@ >-public class CompletionBasicMethod1 { >- void zzfoo() { >- zzfo >- } >-} >\ No newline at end of file >Index: workspace/Completion/src/CompletionBasicPotentialMethodDeclaration1.java >=================================================================== >RCS file: workspace/Completion/src/CompletionBasicPotentialMethodDeclaration1.java >diff -N workspace/Completion/src/CompletionBasicPotentialMethodDeclaration1.java >--- workspace/Completion/src/CompletionBasicPotentialMethodDeclaration1.java 14 Oct 2004 16:02:48 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,3 +0,0 @@ >-public class CompletionBasicPotentialMethodDeclaration1 { >- zzpot >-} >\ No newline at end of file >Index: workspace/Completion/src/CompletionBasicLocalVariable1.java >=================================================================== >RCS file: workspace/Completion/src/CompletionBasicLocalVariable1.java >diff -N workspace/Completion/src/CompletionBasicLocalVariable1.java >--- workspace/Completion/src/CompletionBasicLocalVariable1.java 14 Oct 2004 16:02:48 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,6 +0,0 @@ >-public class CompletionBasicLocalVariable1 { >- void foo() { >- int zzvarzz; >- zzvar >- } >-} >\ No newline at end of file >Index: workspace/Completion/src/CompletionBasicType1.java >=================================================================== >RCS file: workspace/Completion/src/CompletionBasicType1.java >diff -N workspace/Completion/src/CompletionBasicType1.java >--- workspace/Completion/src/CompletionBasicType1.java 14 Oct 2004 16:02:48 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,5 +0,0 @@ >-public class CompletionBasicType1 { >- void foo() { >- Objec >- } >-} >\ No newline at end of file >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.22 >diff -u -r1.22 CompletionTestsRequestor2.java >--- src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java 16 May 2007 18:13:17 -0000 1.22 >+++ src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java 16 Oct 2007 07:33:44 -0000 >@@ -31,6 +31,7 @@ > private boolean showParameterNames; > private boolean showUniqueKeys; > private boolean showPositions; >+ private boolean showTokenPositions; > private boolean shortContext; > private boolean showMissingTypes; > >@@ -53,11 +54,16 @@ > this(showParamNames, showUniqueKeys, showPositions, shortContext, false); > } > public CompletionTestsRequestor2(boolean showParamNames, boolean showUniqueKeys, boolean showPositions, boolean shortContext, boolean showMissingTypes) { >+ this(showParamNames, showUniqueKeys, showPositions, shortContext, showMissingTypes, false); >+ } >+ public CompletionTestsRequestor2(boolean showParamNames, boolean showUniqueKeys, boolean showPositions, boolean shortContext, boolean showMissingTypes, boolean showTokenPositions) { > this.showParameterNames = showParamNames; > this.showUniqueKeys = showUniqueKeys; > this.showPositions = showPositions; >+ this.showTokenPositions = showTokenPositions; > this.shortContext = shortContext; > this.showMissingTypes = showMissingTypes; >+ > } > public void acceptContext(CompletionContext cc) { > this.context = cc; >@@ -334,13 +340,23 @@ > buffer.append(")"); > } > } >+ > if(this.showPositions) { >- buffer.append(", ["); >+ buffer.append(", "); >+ if(this.showTokenPositions) buffer.append("replace"); >+ buffer.append("["); > buffer.append(proposal.getReplaceStart()); > buffer.append(", "); > buffer.append(proposal.getReplaceEnd()); > buffer.append("]"); > } >+ if(this.showTokenPositions) { >+ buffer.append(", token["); >+ buffer.append(proposal.getTokenStart()); >+ buffer.append(", "); >+ buffer.append(proposal.getTokenEnd()); >+ buffer.append("]"); >+ } > buffer.append(", "); > buffer.append(proposal.getRelevance()); > buffer.append('}'); >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.167 >diff -u -r1.167 CompletionTests.java >--- src/org/eclipse/jdt/core/tests/model/CompletionTests.java 20 Aug 2007 14:59:45 -0000 1.167 >+++ src/org/eclipse/jdt/core/tests/model/CompletionTests.java 16 Oct 2007 07:33:43 -0000 >@@ -2386,118 +2386,246 @@ > } > > public void testCompletionBasicField1() throws JavaModelException { >- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(); >- ICompilationUnit cu= getCompilationUnit("Completion", "src", "", "CompletionBasicField1.java"); >- >- String str = cu.getSource(); >+ this.workingCopies = new ICompilationUnit[1]; >+ this.workingCopies[0] = getWorkingCopy( >+ "/Completion/src/CompletionBasicField1.java", >+ "public class CompletionBasicField1 {\n"+ >+ " public int zzvarzz;\n"+ >+ " void foo() {\n"+ >+ " zzvar\n"+ >+ " }\n"+ >+ "}\n"); >+ >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, true, false, true); >+ String str = this.workingCopies[0].getSource(); > String completeBehind = "zzvar"; > int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >- cu.codeComplete(cursorLocation, requestor); >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); > >+ int rStart = str.lastIndexOf("zzvar"); >+ int rEnd = rStart + "zzvar".length(); >+ >+ int tStart = rStart; >+ int tEnd = rEnd; >+ > assertResults( >- "zzvarzz[FIELD_REF]{zzvarzz, LCompletionBasicField1;, I, zzvarzz, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}", >+ "zzvarzz[FIELD_REF]{zzvarzz, LCompletionBasicField1;, I, zzvarzz, null, replace["+rStart+", "+rEnd+"], token["+tStart+", "+tEnd+"], " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}", > requestor.getResults()); > } > > public void testCompletionBasicKeyword1() throws JavaModelException { >- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(); >- ICompilationUnit cu= getCompilationUnit("Completion", "src", "", "CompletionBasicKeyword1.java"); >- >- String str = cu.getSource(); >+ this.workingCopies = new ICompilationUnit[1]; >+ this.workingCopies[0] = getWorkingCopy( >+ "/Completion/src/CompletionBasicKeyword1.java", >+ "public class CompletionBasicKeyword1 {\n"+ >+ " void foo() {\n"+ >+ " whil\n"+ >+ " }\n"+ >+ "}\n"); >+ >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, true, false, true); >+ String str = this.workingCopies[0].getSource(); > String completeBehind = "whil"; > int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >- cu.codeComplete(cursorLocation, requestor); >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); >+ >+ int rStart = str.lastIndexOf("whil"); >+ int rEnd = rStart + "whil".length(); > >+ int tStart = rStart; >+ int tEnd = rEnd; >+ > assertResults( >- "while[KEYWORD]{while, null, null, while, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}", >+ "while[KEYWORD]{while, null, null, while, null, replace["+rStart+", "+rEnd+"], token["+tStart+", "+tEnd+"], " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}", > requestor.getResults()); > } > > public void testCompletionBasicLocalVariable1() throws JavaModelException { >- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(); >- ICompilationUnit cu= getCompilationUnit("Completion", "src", "", "CompletionBasicLocalVariable1.java"); >- >- String str = cu.getSource(); >+ this.workingCopies = new ICompilationUnit[1]; >+ this.workingCopies[0] = getWorkingCopy( >+ "/Completion/src/CompletionBasicLocalVariable1.java", >+ "public class CompletionBasicLocalVariable1 {\n"+ >+ " void foo() {\n"+ >+ " int zzvarzz;\n"+ >+ " zzvar\n"+ >+ " }\n"+ >+ "}\n"); >+ >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, true, false, true); >+ String str = this.workingCopies[0].getSource(); > String completeBehind = "zzvar"; > int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >- cu.codeComplete(cursorLocation, requestor); >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); >+ >+ int rStart = str.lastIndexOf("zzvar"); >+ int rEnd = rStart + "zzvar".length(); > >+ int tStart = rStart; >+ int tEnd = rEnd; >+ > assertResults( >- "zzvarzz[LOCAL_VARIABLE_REF]{zzvarzz, null, I, zzvarzz, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}", >+ "zzvarzz[LOCAL_VARIABLE_REF]{zzvarzz, null, I, zzvarzz, null, replace["+rStart+", "+rEnd+"], token["+tStart+", "+tEnd+"], " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}", > requestor.getResults()); > } > > public void testCompletionBasicMethod1() throws JavaModelException { >- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(); >- ICompilationUnit cu= getCompilationUnit("Completion", "src", "", "CompletionBasicMethod1.java"); >- >- String str = cu.getSource(); >+ this.workingCopies = new ICompilationUnit[1]; >+ this.workingCopies[0] = getWorkingCopy( >+ "/Completion/src/CompletionBasicMethod1.java", >+ "public class CompletionBasicMethod1 {\n"+ >+ " void zzfoo() {\n"+ >+ " zzfo\n"+ >+ " }\n"+ >+ "}\n"); >+ >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, true, false, true); >+ String str = this.workingCopies[0].getSource(); > String completeBehind = "zzfo"; > int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >- cu.codeComplete(cursorLocation, requestor); >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); >+ >+ int rStart = str.lastIndexOf("zzfo"); >+ int rEnd = rStart + "zzfo".length(); > >+ int tStart = rStart; >+ int tEnd = rEnd; >+ > assertResults( >- "zzfoo[METHOD_REF]{zzfoo(), LCompletionBasicMethod1;, ()V, zzfoo, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}", >+ "zzfoo[METHOD_REF]{zzfoo(), LCompletionBasicMethod1;, ()V, zzfoo, null, replace["+rStart+", "+rEnd+"], token["+tStart+", "+tEnd+"], " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}", > requestor.getResults()); > } > > public void testCompletionBasicMethodDeclaration1() throws JavaModelException { >- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(); >- ICompilationUnit cu= getCompilationUnit("Completion", "src", "", "CompletionBasicMethodDeclaration1.java"); >- >- String str = cu.getSource(); >+ this.workingCopies = new ICompilationUnit[1]; >+ this.workingCopies[0] = getWorkingCopy( >+ "/Completion/src/CompletionBasicMethodDeclaration1.java", >+ "public class CompletionBasicMethodDeclaration1 {\n"+ >+ " equals\n"+ >+ "}\n"); >+ >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, true, false, true); >+ String str = this.workingCopies[0].getSource(); > String completeBehind = "equals"; > int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >- cu.codeComplete(cursorLocation, requestor); >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); >+ >+ int rStart = str.lastIndexOf("equals"); >+ int rEnd = rStart + "equals".length(); > >+ int tStart = rStart; >+ int tEnd = rEnd; >+ > assertResults( >- "equals[POTENTIAL_METHOD_DECLARATION]{equals, LCompletionBasicMethodDeclaration1;, ()V, equals, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_NON_RESTRICTED) + "}\n" + >- "equals[METHOD_DECLARATION]{public boolean equals(Object obj), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_METHOD_OVERIDE + R_EXACT_NAME + R_NON_RESTRICTED) + "}", >+ "equals[POTENTIAL_METHOD_DECLARATION]{equals, LCompletionBasicMethodDeclaration1;, ()V, equals, null, replace["+rStart+", "+rEnd+"], token["+tStart+", "+tEnd+"], " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_NON_RESTRICTED) + "}\n" + >+ "equals[METHOD_DECLARATION]{public boolean equals(Object obj), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), replace["+rStart+", "+rEnd+"], token["+tStart+", "+tEnd+"], " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_METHOD_OVERIDE + R_EXACT_NAME + R_NON_RESTRICTED) + "}", > requestor.getResults()); > } > > public void testCompletionBasicPackage1() throws JavaModelException { >- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(); >- ICompilationUnit cu= getCompilationUnit("Completion", "src", "", "CompletionBasicPackage1.java"); >- >- String str = cu.getSource(); >+ this.workingCopies = new ICompilationUnit[1]; >+ this.workingCopies[0] = getWorkingCopy( >+ "/Completion/src/CompletionBasicPackage1.java", >+ "public class CompletionBasicPackage1 {\n"+ >+ " java.lan\n"+ >+ "}\n"); >+ >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, true, false, true); >+ String str = this.workingCopies[0].getSource(); > String completeBehind = "java.lan"; >- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length(); >- cu.codeComplete(cursorLocation, requestor); >+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); >+ >+ int rStart = str.lastIndexOf("java.lan"); >+ int rEnd = rStart + "java.lan".length(); > >+ int tStart = str.lastIndexOf("lan"); >+ int tEnd = tStart + "lan".length(); >+ > assertResults( >- "java.lang[PACKAGE_REF]{java.lang, java.lang, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_QUALIFIED + R_NON_RESTRICTED) + "}", >+ "java.lang[PACKAGE_REF]{java.lang, java.lang, null, null, null, replace["+rStart+", "+rEnd+"], token["+tStart+", "+tEnd+"], " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_QUALIFIED + R_NON_RESTRICTED) + "}", > requestor.getResults()); > } > > > public void testCompletionBasicPotentialMethodDeclaration1() throws JavaModelException { >- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(); >- ICompilationUnit cu= getCompilationUnit("Completion", "src", "", "CompletionBasicPotentialMethodDeclaration1.java"); >- >- String str = cu.getSource(); >+ this.workingCopies = new ICompilationUnit[1]; >+ this.workingCopies[0] = getWorkingCopy( >+ "/Completion/src/CompletionBasicPotentialMethodDeclaration1.java", >+ "public class CompletionBasicPotentialMethodDeclaration1 {\n"+ >+ " zzpot\n"+ >+ "}\n"); >+ >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, true, false, true); >+ String str = this.workingCopies[0].getSource(); > String completeBehind = "zzpot"; > int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >- cu.codeComplete(cursorLocation, requestor); >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); >+ >+ int rStart = str.lastIndexOf("zzpot"); >+ int rEnd = rStart + "zzpot".length(); > >+ int tStart = rStart; >+ int tEnd = rEnd; >+ > assertResults( >- "zzpot[POTENTIAL_METHOD_DECLARATION]{zzpot, LCompletionBasicPotentialMethodDeclaration1;, ()V, zzpot, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_NON_RESTRICTED) + "}", >+ "zzpot[POTENTIAL_METHOD_DECLARATION]{zzpot, LCompletionBasicPotentialMethodDeclaration1;, ()V, zzpot, null, replace["+rStart+", "+rEnd+"], token["+tStart+", "+tEnd+"], " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_NON_RESTRICTED) + "}", > requestor.getResults()); > } > > > public void testCompletionBasicType1() throws JavaModelException { >- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(); >- ICompilationUnit cu= getCompilationUnit("Completion", "src", "", "CompletionBasicType1.java"); >+ this.workingCopies = new ICompilationUnit[1]; >+ this.workingCopies[0] = getWorkingCopy( >+ "/Completion/src/CompletionBasicType1.java", >+ "public class CompletionBasicType1 {\n"+ >+ " void foo() {\n"+ >+ " Objec\n"+ >+ " }\n"+ >+ "}\n"); >+ >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, true, false, true); >+ String str = this.workingCopies[0].getSource(); >+ String completeBehind = "Objec"; >+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); >+ >+ int rStart = str.lastIndexOf("Objec"); >+ int rEnd = rStart + "Objec".length(); > >- String str = cu.getSource(); >+ int tStart = rStart; >+ int tEnd = rEnd; >+ >+ assertResults( >+ "Object[TYPE_REF]{Object, java.lang, Ljava.lang.Object;, null, null, replace["+rStart+", "+rEnd+"], token["+tStart+", "+tEnd+"], " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}", >+ requestor.getResults()); >+} >+ >+public void testCompletionBasicType2() throws JavaModelException { >+ >+ this.workingCopies = new ICompilationUnit[1]; >+ this.workingCopies[0] = getWorkingCopy( >+ "/Completion/src/CompletionBasicType2.java", >+ "public class CompletionBasicType2 {\n"+ >+ " void foo() {\n"+ >+ " java.lang.Objec\n"+ >+ " }\n"+ >+ "}\n"); >+ >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, true, false, true); >+ String str = this.workingCopies[0].getSource(); > String completeBehind = "Objec"; >- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length(); >- cu.codeComplete(cursorLocation, requestor); >+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); >+ >+ int rStart = str.lastIndexOf("java.lang.Objec"); >+ int rEnd = rStart + "java.lang.Objec".length(); > >+ int tStart = str.lastIndexOf("Objec"); >+ int tEnd = tStart + "Objec".length(); >+ > assertResults( >- "Object[TYPE_REF]{Object, java.lang, Ljava.lang.Object;, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}", >- requestor.getResults()); >+ "Object[TYPE_REF]{Object, java.lang, Ljava.lang.Object;, null, null, replace["+rStart+", "+rEnd+"], token["+tStart+", "+tEnd+"], " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}", >+ requestor.getResults()); > } > > public void testCompletionBasicVariableDeclaration1() throws JavaModelException { >@@ -2508,14 +2636,20 @@ > " public Object obj;\n"+ > "}\n"); > >- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, true, false, true); > String str = this.workingCopies[0].getSource(); > String completeBehind = "obj"; > int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); > this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); >+ >+ int rStart = str.lastIndexOf("obj"); >+ int rEnd = rStart + "obj".length(); >+ >+ int tStart = rStart; >+ int tEnd = rEnd; > > assertResults( >- "object[VARIABLE_DECLARATION]{object, null, Ljava.lang.Object;, object, null, " + (R_DEFAULT + R_INTERESTING + R_CASE+ R_NAME_LESS_NEW_CHARACTERS + R_NON_RESTRICTED) + "}", >+ "object[VARIABLE_DECLARATION]{object, null, Ljava.lang.Object;, object, null, replace["+rStart+", "+rEnd+"], token["+tStart+", "+tEnd+"], " + (R_DEFAULT + R_INTERESTING + R_CASE+ R_NAME_LESS_NEW_CHARACTERS + R_NON_RESTRICTED) + "}", > requestor.getResults()); > } > >@@ -10955,15 +11089,23 @@ > "}"); > > >- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, true, false, true); > String str = this.wc.getSource(); > String completeBehind = "xBar(1,"; > int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); > this.wc.codeComplete(cursorLocation, requestor, this.wcOwner); > >+ int rStart1 = str.lastIndexOf("xBar(1,"); >+ int rEnd1 = rStart1 + "xBar(1,".length(); >+ int rStart2 = str.lastIndexOf("xBar(1,") + "xBar(1,".length(); >+ int rEnd2 = rStart2; >+ >+ int tStart = str.lastIndexOf("xBar(1,") + "xBar(1,".length(); >+ int tEnd = tStart; >+ > assertResults( >- "xBar[METHOD_REF]{CompletionPrefixMethodName3.this.xBar(1,, LCompletionPrefixMethodName3;, (II)I, xBar, (a, b), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_NAME+ R_NON_RESTRICTED)+"}\n"+ >- "xBar[METHOD_REF]{, LCompletionPrefixMethodName3$classFoo;, (II)I, xBar, (a, b), "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", >+ "xBar[METHOD_REF]{CompletionPrefixMethodName3.this.xBar(1,, LCompletionPrefixMethodName3;, (II)I, xBar, (a, b), replace["+rStart1+", "+rEnd1+"], token["+tStart+", "+tEnd+"], "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_NAME+ R_NON_RESTRICTED)+"}\n"+ >+ "xBar[METHOD_REF]{, LCompletionPrefixMethodName3$classFoo;, (II)I, xBar, (a, b), replace["+rStart2+", "+rEnd2+"], token["+tStart+", "+tEnd+"], "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", > requestor.getResults()); > } > public void testCompletionQualifiedAllocationType1() throws JavaModelException { >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/core/CompletionProposal.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/core/CompletionProposal.java,v >retrieving revision 1.39 >diff -u -r1.39 CompletionProposal.java >--- model/org/eclipse/jdt/core/CompletionProposal.java 8 Oct 2007 13:14:49 -0000 1.39 >+++ model/org/eclipse/jdt/core/CompletionProposal.java 16 Oct 2007 07:33:55 -0000 >@@ -2049,11 +2049,15 @@ > if (this.key != null) buffer.append(key); > buffer.append(", name:"); //$NON-NLS-1$ > if (this.name != null) buffer.append(this.name); >- buffer.append(", ["); //$NON-NLS-1$ >+ buffer.append(", replace:["); //$NON-NLS-1$ > buffer.append(this.replaceStart); > buffer.append(','); > buffer.append(this.replaceEnd); >- buffer.append("], relevance="); //$NON-NLS-1$ >+ buffer.append("], token:["); //$NON-NLS-1$ >+ buffer.append(this.tokenStart); >+ buffer.append(','); >+ buffer.append(this.tokenEnd); >+ buffer.append("], relevance:"); //$NON-NLS-1$ > buffer.append(this.relevance); > buffer.append('}'); > return buffer.toString(); >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.344 >diff -u -r1.344 CompletionEngine.java >--- codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 15 Oct 2007 17:39:33 -0000 1.344 >+++ codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 16 Oct 2007 07:33:55 -0000 >@@ -301,6 +301,7 @@ > CategorizedProblem problem = null; > char[] fileName = null; > int startPosition, actualCompletionPosition, endPosition, offset; >+ int tokenStart, tokenEnd; > int javadocTagPosition; // Position of previous tag while completing in javadoc > HashtableOfObject knownPkgs = new HashtableOfObject(10); > HashtableOfObject knownTypes = new HashtableOfObject(10); >@@ -691,7 +692,8 @@ > proposal.setName(name); > proposal.setCompletion(name); > proposal.setFlags(Flags.AccDefault); >- proposal.setReplaceRange(CompletionEngine.this.startPosition - CompletionEngine.this.offset, CompletionEngine.this.endPosition - CompletionEngine.this.offset); >+ proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > CompletionEngine.this.requestor.accept(proposal); > if(DEBUG) { >@@ -843,6 +845,7 @@ > proposal.setPackageName(packageName); > proposal.setCompletion(completion); > proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > this.requestor.accept(proposal); > if(DEBUG) { >@@ -916,7 +919,7 @@ > > private boolean complete(ASTNode astNode, ASTNode astNodeParent, Binding qualifiedBinding, Scope scope, boolean insideTypeAnnotation) { > >- setSourceRange(astNode.sourceStart, astNode.sourceEnd); >+ setSourceAndTokenRange(astNode.sourceStart, astNode.sourceEnd); > > scope = computeForbiddenBindings(astNode, astNodeParent, scope); > computeUninterestingBindings(astNodeParent, scope); >@@ -932,7 +935,7 @@ > CompletionOnFieldType field = (CompletionOnFieldType) astNode; > CompletionOnSingleTypeReference type = (CompletionOnSingleTypeReference) field.type; > this.completionToken = type.token; >- setSourceRange(type.sourceStart, type.sourceEnd); >+ setSourceAndTokenRange(type.sourceStart, type.sourceEnd); > > findTypesAndPackages(this.completionToken, scope, true, true, new ObjectVector()); > if (!this.requestor.isIgnored(CompletionProposal.KEYWORD)) { >@@ -955,7 +958,7 @@ > CompletionOnMethodReturnType method = (CompletionOnMethodReturnType) astNode; > SingleTypeReference type = (CompletionOnSingleTypeReference) method.returnType; > this.completionToken = type.token; >- setSourceRange(type.sourceStart, type.sourceEnd); >+ setSourceAndTokenRange(type.sourceStart, type.sourceEnd); > findTypesAndPackages(this.completionToken, scope.parent, true, true, new ObjectVector()); > if (!this.requestor.isIgnored(CompletionProposal.KEYWORD)) { > findKeywordsForMember(this.completionToken, method.modifiers); >@@ -1040,7 +1043,7 @@ > if (this.completionToken.length == 0 && > (astNodeParent instanceof ParameterizedSingleTypeReference || > astNodeParent instanceof ParameterizedQualifiedTypeReference)) { >- this.setSourceRange(astNode.sourceStart, astNode.sourceStart - 1, false); >+ this.setSourceAndTokenRange(astNode.sourceStart, astNode.sourceStart - 1, false); > > findParameterizedType((TypeReference)astNodeParent, scope); > } else { >@@ -1082,7 +1085,7 @@ > long completionPosition = ref.sourcePositions[ref.sourcePositions.length - 1]; > > if (qualifiedBinding.problemId() == ProblemReasons.NotFound) { >- setSourceRange((int) (completionPosition >>> 32), (int) completionPosition); >+ setSourceAndTokenRange((int) (completionPosition >>> 32), (int) completionPosition); > // complete field members with missing fields type > // class X { > // Missing f; >@@ -1108,7 +1111,7 @@ > } > } > } else if (qualifiedBinding instanceof VariableBinding) { >- setSourceRange((int) (completionPosition >>> 32), (int) completionPosition); >+ setSourceAndTokenRange((int) (completionPosition >>> 32), (int) completionPosition); > TypeBinding receiverType = ((VariableBinding) qualifiedBinding).type; > if (receiverType != null) { > findFieldsAndMethods(this.completionToken, receiverType.capture(scope, ref.sourceEnd), scope, ref, scope,false,false, null, null, null, false); >@@ -1141,7 +1144,7 @@ > } else if (qualifiedBinding instanceof ReferenceBinding && !(qualifiedBinding instanceof TypeVariableBinding)) { > boolean isInsideAnnotationAttribute = ref.isInsideAnnotationAttribute; > ReferenceBinding receiverType = (ReferenceBinding) qualifiedBinding; >- setSourceRange((int) (completionPosition >>> 32), (int) completionPosition); >+ setSourceAndTokenRange((int) (completionPosition >>> 32), (int) completionPosition); > > findMembers( > this.completionToken, >@@ -1157,6 +1160,8 @@ > } else if (qualifiedBinding instanceof PackageBinding) { > > setSourceRange(astNode.sourceStart, (int) completionPosition); >+ setTokenRange((int) (completionPosition >>> 32), (int) completionPosition); >+ > // replace to the end of the completion identifier > findTypesAndSubpackages(this.completionToken, (PackageBinding) qualifiedBinding, scope); > } >@@ -1178,7 +1183,7 @@ > // get the source positions of the completion identifier > if (qualifiedBinding instanceof ReferenceBinding && !(qualifiedBinding instanceof TypeVariableBinding)) { > if (!this.requestor.isIgnored(CompletionProposal.TYPE_REF)) { >- setSourceRange((int) (completionPosition >>> 32), (int) completionPosition); >+ setSourceAndTokenRange((int) (completionPosition >>> 32), (int) completionPosition); > > ObjectVector typesFound = new ObjectVector(); > >@@ -1207,6 +1212,7 @@ > } else if (qualifiedBinding instanceof PackageBinding) { > > setSourceRange(astNode.sourceStart, (int) completionPosition); >+ setTokenRange((int) (completionPosition >>> 32), (int) completionPosition); > // replace to the end of the completion identifier > findTypesAndSubpackages(this.completionToken, (PackageBinding) qualifiedBinding, scope); > } >@@ -1214,7 +1220,7 @@ > this.insideQualifiedReference = true; > CompletionOnMemberAccess access = (CompletionOnMemberAccess) astNode; > long completionPosition = access.nameSourcePosition; >- setSourceRange((int) (completionPosition >>> 32), (int) completionPosition); >+ setSourceAndTokenRange((int) (completionPosition >>> 32), (int) completionPosition); > > this.completionToken = access.token; > >@@ -1259,7 +1265,7 @@ > } > > } else if (astNode instanceof CompletionOnMessageSend) { >- setSourceRange(astNode.sourceStart, astNode.sourceEnd, false); >+ setSourceAndTokenRange(astNode.sourceStart, astNode.sourceEnd, false); > > CompletionOnMessageSend messageSend = (CompletionOnMessageSend) astNode; > TypeBinding[] argTypes = computeTypes(messageSend.arguments); >@@ -1291,7 +1297,7 @@ > } > } else if (astNode instanceof CompletionOnExplicitConstructorCall) { > if (!this.requestor.isIgnored(CompletionProposal.METHOD_REF)) { >- setSourceRange(astNode.sourceStart, astNode.sourceEnd, false); >+ setSourceAndTokenRange(astNode.sourceStart, astNode.sourceEnd, false); > > CompletionOnExplicitConstructorCall constructorCall = > (CompletionOnExplicitConstructorCall) astNode; >@@ -1304,7 +1310,7 @@ > false); > } > } else if (astNode instanceof CompletionOnQualifiedAllocationExpression) { >- setSourceRange(astNode.sourceStart, astNode.sourceEnd, false); >+ setSourceAndTokenRange(astNode.sourceStart, astNode.sourceEnd, false); > > CompletionOnQualifiedAllocationExpression allocExpression = > (CompletionOnQualifiedAllocationExpression) astNode; >@@ -1333,7 +1339,7 @@ > } else if (astNode instanceof CompletionOnClassLiteralAccess) { > if (!this.requestor.isIgnored(CompletionProposal.FIELD_REF)) { > CompletionOnClassLiteralAccess access = (CompletionOnClassLiteralAccess) astNode; >- setSourceRange(access.classStart, access.sourceEnd); >+ setSourceAndTokenRange(access.classStart, access.sourceEnd); > > this.completionToken = access.completionIdentifier; > >@@ -1343,7 +1349,7 @@ > if (!this.requestor.isIgnored(CompletionProposal.VARIABLE_DECLARATION)) { > CompletionOnMethodName method = (CompletionOnMethodName) astNode; > >- setSourceRange(method.sourceStart, method.selectorEnd); >+ setSourceAndTokenRange(method.sourceStart, method.selectorEnd); > > FieldBinding[] fields = scope.enclosingSourceType().fields(); > char[][] excludeNames = new char[fields.length][]; >@@ -1418,7 +1424,7 @@ > > this.completionToken = ref.completionIdentifier; > long completionPosition = ref.sourcePositions[ref.tokens.length]; >- setSourceRange((int) (completionPosition >>> 32), (int) completionPosition); >+ setSourceAndTokenRange((int) (completionPosition >>> 32), (int) completionPosition); > > ObjectVector typesFound = new ObjectVector(); > if (this.assistNodeIsException && astNodeParent instanceof TryStatement) { >@@ -1460,7 +1466,7 @@ > if (annot.type instanceof CompletionOnSingleTypeReference) { > CompletionOnSingleTypeReference type = (CompletionOnSingleTypeReference) annot.type; > this.completionToken = type.token; >- setSourceRange(type.sourceStart, type.sourceEnd); >+ setSourceAndTokenRange(type.sourceStart, type.sourceEnd); > > findTypesAndPackages(this.completionToken, scope, false, false, new ObjectVector()); > } else if (annot.type instanceof CompletionOnQualifiedTypeReference) { >@@ -1472,10 +1478,11 @@ > if (qualifiedBinding instanceof PackageBinding) { > > setSourceRange(astNode.sourceStart, (int) completionPosition); >+ setTokenRange((int) (completionPosition >>> 32), (int) completionPosition); > // replace to the end of the completion identifier > findTypesAndSubpackages(this.completionToken, (PackageBinding) qualifiedBinding, scope); > } else { >- setSourceRange((int) (completionPosition >>> 32), (int) completionPosition); >+ setSourceAndTokenRange((int) (completionPosition >>> 32), (int) completionPosition); > > findMemberTypes( > this.completionToken, >@@ -1584,7 +1591,7 @@ > CompletionOnJavadocSingleTypeReference typeRef = (CompletionOnJavadocSingleTypeReference) astNode; > this.completionToken = typeRef.token; > this.javadocTagPosition = typeRef.tagSourceStart; >- setSourceRange(typeRef.sourceStart, typeRef.sourceEnd); >+ setSourceAndTokenRange(typeRef.sourceStart, typeRef.sourceEnd); > findTypesAndPackages( > this.completionToken, > scope, >@@ -1606,7 +1613,7 @@ > if (!this.requestor.isIgnored(CompletionProposal.TYPE_REF) || > ((this.assistNodeInJavadoc & CompletionOnJavadoc.TEXT) != 0 && !this.requestor.isIgnored(CompletionProposal.JAVADOC_TYPE_REF))) { > int rangeStart = typeRef.completeInText() ? typeRef.sourceStart : (int) (completionPosition >>> 32); >- setSourceRange(rangeStart, (int) completionPosition); >+ setSourceAndTokenRange(rangeStart, (int) completionPosition); > findMemberTypes( > this.completionToken, > (ReferenceBinding) qualifiedBinding, >@@ -1623,6 +1630,8 @@ > } else if (qualifiedBinding instanceof PackageBinding) { > > setSourceRange(astNode.sourceStart, (int) completionPosition); >+ int rangeStart = typeRef.completeInText() ? typeRef.sourceStart : (int) (completionPosition >>> 32); >+ setTokenRange(rangeStart, (int) completionPosition); > // replace to the end of the completion identifier > findTypesAndSubpackages(this.completionToken, (PackageBinding) qualifiedBinding, scope); > } >@@ -1644,7 +1653,7 @@ > } else if (fieldRef.completeInText()) { > rangeStart = fieldRef.receiver.sourceStart; > } >- setSourceRange(rangeStart, (int) completionPosition); >+ setSourceAndTokenRange(rangeStart, (int) completionPosition); > > if (!this.requestor.isIgnored(CompletionProposal.FIELD_REF) > || !this.requestor.isIgnored(CompletionProposal.JAVADOC_FIELD_REF)) { >@@ -1710,7 +1719,7 @@ > } else if (messageSend.completeInText()) { > rangeStart = messageSend.receiver.sourceStart; > } >- setSourceRange(rangeStart, astNode.sourceEnd, false); >+ setSourceAndTokenRange(rangeStart, astNode.sourceEnd, false); > > if (qualifiedBinding == null) { > if (!this.requestor.isIgnored(CompletionProposal.METHOD_REF)) { >@@ -1750,7 +1759,7 @@ > } else if (allocExpression.completeInText()) { > rangeStart = allocExpression.type.sourceStart; > } >- setSourceRange(rangeStart, astNode.sourceEnd, false); >+ setSourceAndTokenRange(rangeStart, astNode.sourceEnd, false); > TypeBinding[] argTypes = computeTypes(allocExpression.arguments); > > ReferenceBinding ref = (ReferenceBinding) qualifiedBinding; >@@ -1760,19 +1769,19 @@ > } else if (astNode instanceof CompletionOnJavadocParamNameReference) { > if (!this.requestor.isIgnored(CompletionProposal.JAVADOC_PARAM_REF)) { > CompletionOnJavadocParamNameReference paramRef = (CompletionOnJavadocParamNameReference) astNode; >- setSourceRange(paramRef.tagSourceStart, paramRef.tagSourceEnd); >+ setSourceAndTokenRange(paramRef.tagSourceStart, paramRef.tagSourceEnd); > findJavadocParamNames(paramRef.token, paramRef.missingParams, false); > findJavadocParamNames(paramRef.token, paramRef.missingTypeParams, true); > } > } else if (astNode instanceof CompletionOnJavadocTypeParamReference) { > if (!this.requestor.isIgnored(CompletionProposal.JAVADOC_PARAM_REF)) { > CompletionOnJavadocTypeParamReference paramRef = (CompletionOnJavadocTypeParamReference) astNode; >- setSourceRange(paramRef.tagSourceStart, paramRef.tagSourceEnd); >+ setSourceAndTokenRange(paramRef.tagSourceStart, paramRef.tagSourceEnd); > findJavadocParamNames(paramRef.token, paramRef.missingParams, true); > } > } else if (astNode instanceof CompletionOnJavadocTag) { > CompletionOnJavadocTag javadocTag = (CompletionOnJavadocTag) astNode; >- setSourceRange(javadocTag.tagSourceStart, javadocTag.sourceEnd); >+ setSourceAndTokenRange(javadocTag.tagSourceStart, javadocTag.sourceEnd); > findJavadocBlockTags(javadocTag); > findJavadocInlineTags(javadocTag); > } >@@ -2001,7 +2010,7 @@ > this.buildContext(importReference, null, null, null); > > long positions = importReference.sourcePositions[importReference.sourcePositions.length - 1]; >- setSourceRange((int) (positions >>> 32), (int) positions); >+ setSourceAndTokenRange((int) (positions >>> 32), (int) positions); > > char[][] oldTokens = importReference.tokens; > int tokenCount = oldTokens.length; >@@ -2048,7 +2057,7 @@ > contextAccepted = true; > this.buildContext(importReference, null, null, null); > if(!this.requestor.isIgnored(CompletionProposal.KEYWORD)) { >- setSourceRange(importReference.sourceStart, importReference.sourceEnd); >+ setSourceAndTokenRange(importReference.sourceStart, importReference.sourceEnd); > CompletionOnKeyword keyword = (CompletionOnKeyword)importReference; > findKeywords(keyword.getToken(), keyword.getPossibleKeywords(), false, false); > } >@@ -2232,6 +2241,7 @@ > proposal.setCompletion(method.selector); > proposal.setFlags(method.modifiers); > proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > this.requestor.accept(proposal); > if(DEBUG) { >@@ -2275,6 +2285,7 @@ > proposal.setCompletion(completion); > proposal.setFlags(Flags.AccPublic); > proposal.setReplaceRange(this.endPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenEnd - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > this.requestor.accept(proposal); > if(DEBUG) { >@@ -2335,6 +2346,7 @@ > proposal.setCompletion(classField); > proposal.setFlags(Flags.AccStatic | Flags.AccPublic); > proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > this.requestor.accept(proposal); > if(DEBUG) { >@@ -2402,6 +2414,7 @@ > proposal.setCompletion(completion); > proposal.setFlags(field.modifiers); > proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > this.requestor.accept(proposal); > if(DEBUG) { >@@ -2682,6 +2695,7 @@ > proposal.setCompletion(completion); > proposal.setFlags(constructor.modifiers); > proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > if(parameterNames != null) proposal.setParameterNames(parameterNames); > this.requestor.accept(proposal); >@@ -2767,6 +2781,7 @@ > proposal.setCompletion(completion); > proposal.setFlags(constructor.modifiers); > proposal.setReplaceRange(this.endPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenEnd - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > if(parameterNames != null) proposal.setParameterNames(parameterNames); > this.requestor.accept(proposal); >@@ -2855,6 +2870,7 @@ > proposal.setFlags(constructor.modifiers); > int start = (this.assistNodeInJavadoc > 0) ? this.startPosition : this.endPosition; > proposal.setReplaceRange(start - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > if(parameterNames != null) proposal.setParameterNames(parameterNames); > this.requestor.accept(proposal); >@@ -2881,9 +2897,9 @@ > proposal.setIsContructor(true); > proposal.setCompletion(javadocCompletion); > proposal.setFlags(constructor.modifiers); >- int start = (this.assistNodeInJavadoc > 0) ? this.startPosition : this.endPosition; >- if ((this.assistNodeInJavadoc & CompletionOnJavadoc.REPLACE_TAG) != 0) start = this.javadocTagPosition; >+ int start = (this.assistNodeInJavadoc & CompletionOnJavadoc.REPLACE_TAG) != 0 ? this.javadocTagPosition : this.startPosition; > proposal.setReplaceRange(start - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance+R_INLINE_TAG); > if(parameterNames != null) proposal.setParameterNames(parameterNames); > this.requestor.accept(proposal); >@@ -3110,6 +3126,7 @@ > proposal.setCompletion(completion); > proposal.setFlags(field.modifiers); > proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > this.requestor.accept(proposal); > if(DEBUG) { >@@ -3132,6 +3149,7 @@ > proposal.setFlags(field.modifiers); > int start = (this.assistNodeInJavadoc & CompletionOnJavadoc.REPLACE_TAG) != 0 ? this.javadocTagPosition : this.startPosition; > proposal.setReplaceRange(start - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance+R_INLINE_TAG); > this.requestor.accept(proposal); > if(DEBUG) { >@@ -3151,6 +3169,7 @@ > valueProposal.setCompletion(javadocCompletion); > valueProposal.setFlags(field.modifiers); > valueProposal.setReplaceRange(start - this.offset, this.endPosition - this.offset); >+ valueProposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > valueProposal.setRelevance(relevance+R_VALUE_TAG); > this.requestor.accept(valueProposal); > if(DEBUG) { >@@ -3330,6 +3349,7 @@ > proposal.setCompletion(lengthField); > proposal.setFlags(Flags.AccPublic); > proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > this.requestor.accept(proposal); > if(DEBUG) { >@@ -3400,6 +3420,7 @@ > proposal.setCompletion(completion); > proposal.setFlags(Flags.AccPublic); > proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > this.requestor.accept(proposal); > if(DEBUG) { >@@ -3772,6 +3793,7 @@ > proposal.setCompletion(completion); > proposal.setFlags(field.modifiers); > proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > > char[] typeImportCompletion = createImportCharArray(typeName, false, false); >@@ -3788,6 +3810,7 @@ > typeImportProposal.setFlags(receiverType.modifiers); > typeImportProposal.setAdditionalFlags(CompletionFlags.Default); > typeImportProposal.setReplaceRange(importStart - this.offset, importEnd - this.offset); >+ typeImportProposal.setTokenRange(importStart - this.offset, importEnd - this.offset); > typeImportProposal.setRelevance(relevance); > > proposal.setRequiredProposals(new CompletionProposal[]{typeImportProposal}); >@@ -3812,6 +3835,7 @@ > proposal.setCompletion(completion); > proposal.setFlags(field.modifiers); > proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > > char[] fieldImportCompletion = createImportCharArray(CharOperation.concat(typeName, field.name, '.'), true, false); >@@ -3828,6 +3852,7 @@ > fieldImportProposal.setFlags(field.modifiers); > fieldImportProposal.setAdditionalFlags(CompletionFlags.StaticImport); > fieldImportProposal.setReplaceRange(importStart - this.offset, importEnd - this.offset); >+ fieldImportProposal.setTokenRange(importStart - this.offset, importEnd - this.offset); > fieldImportProposal.setRelevance(relevance); > > proposal.setRequiredProposals(new CompletionProposal[]{fieldImportProposal}); >@@ -3986,6 +4011,7 @@ > proposal.setCompletion(completionName); > proposal.setFlags(field.modifiers); > proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > this.requestor.accept(proposal); > if(DEBUG) { >@@ -4056,6 +4082,7 @@ > proposal.setCompletion(completionName); > proposal.setFlags(method.modifiers); > proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > if(parameterNames != null) proposal.setParameterNames(parameterNames); > this.requestor.accept(proposal); >@@ -4089,6 +4116,7 @@ > System.arraycopy(possibleTag, 0, completion, 1, tagLength); > proposal.setCompletion(completion); > proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > this.requestor.accept(proposal); > if (DEBUG) { >@@ -4126,6 +4154,7 @@ > completion[tagLength+2] = '}'; > proposal.setCompletion(completion); > proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > this.requestor.accept(proposal); > if (DEBUG) { >@@ -4163,6 +4192,7 @@ > proposal.setName(choices[i]); > proposal.setCompletion(choices[i]); > proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > this.requestor.accept(proposal); > if(DEBUG) { >@@ -4195,6 +4225,7 @@ > proposal.setName(choices[i]); > proposal.setCompletion(choices[i]); > proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > this.requestor.accept(proposal); > if(DEBUG) { >@@ -4345,6 +4376,7 @@ > proposal.setName(Keywords.THIS); > proposal.setCompletion(Keywords.THIS); > proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > this.requestor.accept(proposal); > if (DEBUG) { >@@ -4771,6 +4803,7 @@ > char[] completion = isTypeParam ? CharOperation.concat('<', argName, '>') : argName; > proposal.setCompletion(completion); > proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(--relevance); > this.requestor.accept(proposal); > if (DEBUG) { >@@ -5111,6 +5144,7 @@ > char[] completion = CharOperation.NO_CHAR; > > int previousStartPosition = this.startPosition; >+ int previousTokenStart = this.tokenStart; > > // Special case for completion in javadoc > if (this.assistNodeInJavadoc > 0) { >@@ -5176,6 +5210,7 @@ > } else { > this.startPosition = this.endPosition; > } >+ this.tokenStart = this.tokenEnd; > } > > if(prefixRequired || this.options.forceImplicitQualification){ >@@ -5231,6 +5266,7 @@ > proposal.setCompletion(completion); > proposal.setFlags(method.modifiers); > proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > if(parameterNames != null) proposal.setParameterNames(parameterNames); > this.requestor.accept(proposal); >@@ -5260,6 +5296,7 @@ > proposal.setFlags(method.modifiers); > int start = (this.assistNodeInJavadoc & CompletionOnJavadoc.REPLACE_TAG) != 0 ? this.javadocTagPosition : this.startPosition; > proposal.setReplaceRange(start - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance+R_INLINE_TAG); > if(parameterNames != null) proposal.setParameterNames(parameterNames); > this.requestor.accept(proposal); >@@ -5268,6 +5305,7 @@ > } > } > this.startPosition = previousStartPosition; >+ this.tokenStart = previousTokenStart; > } > > methodsFound.addAll(newMethodsFound); >@@ -5371,6 +5409,7 @@ > char[] completion = CharOperation.NO_CHAR; > > int previousStartPosition = this.startPosition; >+ int previousTokenStart = this.tokenStart; > > if (this.source != null > && this.source.length > this.endPosition >@@ -5417,6 +5456,7 @@ > proposal.setCompletion(completion); > proposal.setFlags(method.modifiers); > proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > if(parameterNames != null) proposal.setParameterNames(parameterNames); > >@@ -5445,6 +5485,7 @@ > proposal.setCompletion(completion); > proposal.setFlags(method.modifiers); > proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > if(parameterNames != null) proposal.setParameterNames(parameterNames); > >@@ -5462,6 +5503,7 @@ > typeImportProposal.setFlags(receiverType.modifiers); > typeImportProposal.setAdditionalFlags(CompletionFlags.Default); > typeImportProposal.setReplaceRange(importStart - this.offset, importEnd - this.offset); >+ typeImportProposal.setTokenRange(importStart - this.offset, importEnd - this.offset); > typeImportProposal.setRelevance(relevance); > > proposal.setRequiredProposals(new CompletionProposal[]{typeImportProposal}); >@@ -5490,6 +5532,7 @@ > proposal.setCompletion(completion); > proposal.setFlags(method.modifiers); > proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > if(parameterNames != null) proposal.setParameterNames(parameterNames); > >@@ -5512,6 +5555,7 @@ > methodImportProposal.setFlags(method.modifiers); > methodImportProposal.setAdditionalFlags(CompletionFlags.StaticImport); > methodImportProposal.setReplaceRange(importStart - this.offset, importEnd - this.offset); >+ methodImportProposal.setTokenRange(importStart - this.offset, importEnd - this.offset); > methodImportProposal.setRelevance(relevance); > if(parameterNames != null) methodImportProposal.setParameterNames(parameterNames); > >@@ -5525,6 +5569,7 @@ > } > > this.startPosition = previousStartPosition; >+ this.tokenStart = previousTokenStart; > } > } > >@@ -5547,6 +5592,7 @@ > proposal.setCompletion(fullyQualifiedName); > proposal.setFlags(typeBinding.modifiers); > proposal.setReplaceRange(start - this.offset, end - this.offset); >+ proposal.setTokenRange(start - this.offset, end - this.offset); > proposal.setRelevance(relevance); > } else if (binding instanceof PackageBinding) { > PackageBinding packageBinding = (PackageBinding) binding; >@@ -5558,6 +5604,7 @@ > proposal.setPackageName(packageName); > proposal.setCompletion(packageName); > proposal.setReplaceRange(start - this.offset, end - this.offset); >+ proposal.setTokenRange(start - this.offset, end - this.offset); > proposal.setRelevance(relevance); > } > return proposal; >@@ -5627,6 +5674,7 @@ > char[] completion = CharOperation.NO_CHAR; > > int previousStartPosition = this.startPosition; >+ int previousTokenStart = this.tokenStart; > > // nothing to insert - do not want to replace the existing selector & arguments > if (this.source != null >@@ -5665,6 +5713,7 @@ > proposal.setCompletion(completion); > proposal.setFlags(method.modifiers); > proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > if(parameterNames != null) proposal.setParameterNames(parameterNames); > this.requestor.accept(proposal); >@@ -5673,6 +5722,7 @@ > } > } > this.startPosition = previousStartPosition; >+ this.tokenStart = previousTokenStart; > } > > methodsFound.addAll(newMethodsFound); >@@ -5857,6 +5907,7 @@ > proposal.setName(choices[i]); > proposal.setCompletion(choices[i]); > proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > this.requestor.accept(proposal); > if(DEBUG) { >@@ -5991,6 +6042,7 @@ > proposal.setName(method.selector); > proposal.setFlags(method.modifiers); > proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > if(parameterNames != null) proposal.setParameterNames(parameterNames); > this.requestor.accept(proposal); >@@ -6597,6 +6649,8 @@ > return; > > setSourceRange(packageStatement.sourceStart, packageStatement.sourceEnd); >+ long completionPosition = packageStatement.sourcePositions[packageStatement.sourcePositions.length - 1]; >+ setTokenRange((int) (completionPosition >>> 32), (int) completionPosition); > this.nameEnvironment.findPackages(CharOperation.toLowerCase(this.completionToken), this); > } > >@@ -6933,6 +6987,7 @@ > proposal.setCompletion(completionName); > proposal.setFlags(refBinding.modifiers); > proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > proposal.setAccessibility(accessibility); > this.requestor.accept(proposal); >@@ -7195,6 +7250,7 @@ > proposal.setCompletion(typeBinding.sourceName()); > proposal.setFlags(typeBinding.modifiers); > proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > this.requestor.accept(proposal); > if(DEBUG) { >@@ -7295,6 +7351,7 @@ > proposal.setCompletion(local.name); > proposal.setFlags(local.modifiers); > proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > this.requestor.accept(proposal); > if(DEBUG) { >@@ -7515,6 +7572,7 @@ > proposal.setCompletion(name); > //proposal.setFlags(Flags.AccDefault); > proposal.setReplaceRange(CompletionEngine.this.startPosition - CompletionEngine.this.offset, CompletionEngine.this.endPosition - CompletionEngine.this.offset); >+ proposal.setTokenRange(CompletionEngine.this.tokenStart - CompletionEngine.this.offset, CompletionEngine.this.tokenEnd - CompletionEngine.this.offset); > proposal.setRelevance(relevance); > CompletionEngine.this.requestor.accept(proposal); > if(DEBUG) { >@@ -7782,6 +7840,7 @@ > proposal.setCompletion(name); > //proposal.setFlags(Flags.AccDefault); > proposal.setReplaceRange(CompletionEngine.this.startPosition - CompletionEngine.this.offset, CompletionEngine.this.endPosition - CompletionEngine.this.offset); >+ proposal.setTokenRange(CompletionEngine.this.tokenStart - CompletionEngine.this.offset, CompletionEngine.this.tokenEnd - CompletionEngine.this.offset); > proposal.setRelevance(relevance); > CompletionEngine.this.requestor.accept(proposal); > if(DEBUG) { >@@ -7952,11 +8011,20 @@ > this.knownTypes = new HashtableOfObject(10); > } > >+ private void setSourceAndTokenRange(int start, int end) { >+ this.setSourceAndTokenRange(start, end, true); >+ } >+ >+ private void setSourceAndTokenRange(int start, int end, boolean emptyTokenAdjstment) { >+ this.setSourceRange(start, end, emptyTokenAdjstment); >+ this.setTokenRange(start, end, emptyTokenAdjstment); >+ } >+ > private void setSourceRange(int start, int end) { > this.setSourceRange(start, end, true); > } >- >- private void setSourceRange(int start, int end, boolean emptyTokenAdjstment) { >+ >+ private void setSourceRange(int start, int end, boolean emptyTokenAdjstment) { > this.startPosition = start; > if(emptyTokenAdjstment) { > int endOfEmptyToken = ((CompletionScanner)this.parser.scanner).endOfEmptyToken; >@@ -7965,6 +8033,20 @@ > this.endPosition = end + 1; > } > } >+ >+ private void setTokenRange(int start, int end) { >+ this.setTokenRange(start, end, true); >+ } >+ >+ private void setTokenRange(int start, int end, boolean emptyTokenAdjstment) { >+ this.tokenStart = start; >+ if(emptyTokenAdjstment) { >+ int endOfEmptyToken = ((CompletionScanner)this.parser.scanner).endOfEmptyToken; >+ this.tokenEnd = endOfEmptyToken > end ? endOfEmptyToken + 1 : end + 1; >+ } else { >+ this.tokenEnd = end + 1; >+ } >+ } > private char[][] computeAlreadyDefinedName( > BlockScope scope, > InvocationSite invocationSite) { >@@ -8646,6 +8728,7 @@ > proposal.setCompletion(token); > proposal.setFlags(Flags.AccPublic); > proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > this.requestor.accept(proposal); > if(DEBUG) { >@@ -8834,6 +8917,7 @@ > proposal.setCompletion(completionName); > proposal.setFlags(modifiers); > proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > proposal.setAccessibility(accessibility); > this.requestor.accept(proposal); >@@ -8856,6 +8940,7 @@ > proposal.setFlags(modifiers); > int start = (this.assistNodeInJavadoc & CompletionOnJavadoc.REPLACE_TAG) != 0 ? this.javadocTagPosition : this.startPosition; > proposal.setReplaceRange(start - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance+R_INLINE_TAG); > proposal.setAccessibility(accessibility); > this.requestor.accept(proposal); >@@ -8903,6 +8988,7 @@ > proposal.setCompletion(completionName); > proposal.setFlags(refBinding.modifiers); > proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > this.requestor.accept(proposal); > if(DEBUG) { >@@ -8924,6 +9010,7 @@ > proposal.setFlags(refBinding.modifiers); > int start = (this.assistNodeInJavadoc & CompletionOnJavadoc.REPLACE_TAG) != 0 ? this.javadocTagPosition : this.startPosition; > proposal.setReplaceRange(start - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance+R_INLINE_TAG); > this.requestor.accept(proposal); > if(DEBUG) { >@@ -8948,6 +9035,7 @@ > proposal.setCompletion(completionName); > proposal.setFlags(typeParameter.modifiers); > proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance); > this.requestor.accept(proposal); > if(DEBUG) { >@@ -8966,6 +9054,7 @@ > proposal.setCompletion(javadocCompletion); > proposal.setFlags(typeParameter.modifiers); > proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset); > proposal.setRelevance(relevance+R_INLINE_TAG); > this.requestor.accept(proposal); > if(DEBUG) { >@@ -9113,6 +9202,11 @@ > printDebugTab(tab, buffer); > buffer.append("\tReplaceStart[").append(start).append("]"); //$NON-NLS-1$ //$NON-NLS-2$ > buffer.append("-ReplaceEnd[").append(end).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$ >+ start = proposal.getTokenStart(); >+ end = proposal.getTokenEnd(); >+ printDebugTab(tab, buffer); >+ buffer.append("\tTokenStart[").append(start).append("]"); //$NON-NLS-1$ //$NON-NLS-2$ >+ buffer.append("-TokenEnd[").append(end).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$ > if (this.source != null) { > printDebugTab(tab, buffer); > buffer.append("\tReplacedText[").append(this.source, start, end-start).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$
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 206336
: 80416