Skip to content

Should SourceCodePositioner (and other classes) consider all kinds of line breaks? #3972

Answered by oowekyala
Marcono1234 asked this question in Q&A
Discussion options

You must be logged in to vote

PMD 7 does consider all of \n, \r, and \r\n - the PR is still pending: #3893 (comment)

I'm not sure it makes sense to change this in PMD 6. SourceCodePositioner does work with \r\n because splitting lines on \n also splits correctly \r\n (see #3893 (comment)), and so text coordinates work the same. It doesn't support single \r, but that's AFAIK only used on machines that are relatively rare nowadays: https://en.wikipedia.org/wiki/Newline#Representation

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Marcono1234
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants