-
-
Notifications
You must be signed in to change notification settings - Fork 358
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
bug: Comments are probably not parsed well on Mac #1460
Comments
I agree with you but I wonder if the step 1 is not already processed by JDT? |
It is probably not a good idea, because that will influence source position offsets and will make the sniper mode and similar algorithms more difficult. After deeper thinking about this EOL problem it looks like Spoon touches this problem only when parsing comments. All other Java nodes are EOL independent - JDT compiler handles EOL well and the Java AST nodes do not care about EOLs in origin files. So it looks like refactoring of There remains one question: I vote for A) Note, that I am not speaking about Pretty printing which will of course use configured EOL, which may be different too. |
I have checked current implementation and So the remaining problem is to fix bug in comments handling on Mac OS, which are using "\r" |
Actually "\r" was used on older version of MacOS (9 and below): I'm using Mac and I tried to create a new test in #1679 and it seems to return the documentation correctly. |
JDTCommentBuilder#cleanComment
method splits lines by Linux\n
and then cleans up remaining MS Windows
\r
. I guess that this algorithm will not work on Mac, which uses\r
as EOL.The handling of EOL in spoon seems to be not consistent. May be the best would be to
\r\n
and\r
to Linux\n
\n
WDYT?
I am not not going to develop anything here. I just noted that it should be handled somehow during #1455, which is hard for me to test, because I am not able to say what behavior is correct concerning EOL... and Spoon.
Are there already some rules how EOLs should be handled by Spoon?
The text was updated successfully, but these errors were encountered: