-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Normalize all EOLs as LF #163
Comments
I'm not strongly opinionated here, but I've looked at this a bit in the light of cross-channel. Interestingly, this change would benefit cross channel in a scenario where an old file has windows line endings, and a new one got that "fixed". With newline normalization, the old and the new white-space are considered equal, and that avoids duplication. I'm not sure about I checked locally, I wouldn't see a positive impact of that in cross-channel, missing trailing newline seems to be supported well by the current behavior. |
As I make progress in #160, I see that it removes all hardcoded |
This would help high-performance parsers in particular. As I noted in the previous conversation, the EOL problem is a type of problem where most of the time we pay maximal price to satisfy least likely scenario. This feels wrong. Removing that allows any system that requires CRLF to In favor. |
I think maybe my description of this issue wasn't clear. Or maybe I've misunderstood your comment :) I only propose that we don't store |
@Pike Thanks for verifying this proposal in light of the current Mozilla tooling.
Yeah, I'm also not sure about this. This is only important for |
To put it differently: the EBNF is not where we define where spans start and end. |
We talked about this OTP and the consensus was to go ahead with the normalization of supported EOLs ( |
I propose that the AST normalize the parsing of all supported line endings to
LF
. We already useLF
to represent blank lines in multiline patterns. Normalizing line endings in the parsed results removes surprises and ensures consistency across platforms.Serializers can implement an option to serialize using
CRLF
if so desired or required by the platform.In essence, this is similar to git's
core.autocrlf = input
option.The text was updated successfully, but these errors were encountered: