Open LeoLuxo opened 3 months ago
Sounds good to me for now to get the ball rolling for all contributors working on Windows.
We possibly want to preserve the line endings as this parser implementation is envisioned to also be used in a loss less context for a code formatter (and to keep it simple for the LSP implementation).
We probably need additional tests for that at some point but it sounds like a bit too much trouble for the simple insta
testing right now. (maybe we can add some automated way to test both line endings from one kind of format, as we probably want coverage in anything that tries to handle line endings manually.)
@LeoLuxo Can you move this PR to https://github.com/nushell/new-nu-parser? We're moving this repository under the nushell org.
This fixes running tests on Windows by replacing all CRLF line endings with LF before running tests. Without this, running the tests on Windows results in different spans from the snapshots, failing the tests.
This does not change the parsing though, where both CRLF and LF lines endings still need to be accounted for. (Although perhaps we could make this a global pre-parsing pass too?)