Community
Participate
Working Groups
Build Identifier: I20100313-1044 OS: Windows 7 (64bit), XP, SLES11 JRE: IBM JRE 1.6 Build:I20100313-1044 After creating a label that has Ext-B character at the top. content assist can not propose the correct label. It drops the first character. For example, when the label is "U+20B9Fabc", the result is "abc". Reproducible: Always Steps to Reproduce: 1.Create a Java project. 2.Edit Java source code and type a label that has Ext-B character at the top. 3.Write "while(true) break " and type Ctrl+Space, 4.You see "abc" is a proposal and it drops the first character. FYI: this is a sample source code -------------------------------- public class Test { public static void main(String[] args) { 𠮟abc: // U+20B9F a b c while (true) { // Type "break " and Ctrl+Space, // It drop an Ext-B character at the top break 𠮟abc; // You may see "abc", } } } --------------------------------
Could you please attach a sample file and mention the encoding you used to save the file. Thanks.
Created attachment 163374 [details] Bug307486.java (import this with UTF-8 encoding) I attached a sample code.
The LABEL_REF proposal from JDT Core is wrong.
Ayush, please investigate.
Ayush, this is similar to the problem I fixed today with codeSelect(..) and surrogates characters. I'll take care of this.
The CompletionScanner doesn't support surrogate characters at the starting position of an identifier. The fix is trivial.
Created attachment 164120 [details] Proposed fix + regression test
Released for 3.6M7. Added regression test in: org.eclipse.jdt.core.tests.model.CompletionTests_1_5#testLabel
Verified in N20100408-2000.
I also verified this bug is fixed in I20100426-0852 as the reporter.