Community
Participate
Working Groups
Build Identifier: M20110909-1335 (Eclipse 3.7.1) In my language I use the org.eclipse.jface.text.rules.MultilineRule to detect /* ... */ comments, and now /** just before the end of the file is detected as multiline comment... (I have no javadoc style /** ... */ comments) I investigated why this happens, and found out that the org.eclipse.jface.text.rules.PatternRule class does not always honor the fBreaksOnEOF field. In the endSequenceDetected method, the sequenceDetected method is called several times with true as third and final argument. This eofAllowed argument "indicates whether EOF terminates the pattern". I belive the value true should not be provided. Instead the value of the fBreaksOnEOF field should be provided as argument. Reproducible: Always Steps to Reproduce: 1. Use a MultilineRule for /* ... */ comments for syntax highlighting in a text editor. 2. Observe how /** just before end of file is detected as comment.
Can you either provide steps to reproduce it using the Eclipse SDK (e.g. in a Java file) or provide a test case? Thanks.
Created attachment 209255 [details] Test case. This attachment contains a Java plug-in project with a test editor. Extract the files and import the project into Eclipse. Then launch a sub-Eclipse instance, and import the project there as well. Open the *.test files in the test_files directory to confirm the bug. That is, for test1.test the /** is highlighted in red, as a comment, because it is immediately followed by end of file. In test2.test however, I added a newline after it, and you see that it is no longer highlighted.
Fixed in master: 8c2cb21c418afbdf3849e3a0c31b0b67aab853cf
Also added test case in master: ffc8144b38d604904081eaba5ed19ab3065646f3
The fix caused a regression (see bug 409538).