This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Description
Windows 10 Version 1709 (OS Build 16299.431)
Visual Studio Code Version 1.23.1 with Haskell Language Server 0.0.16
HIE 0.2.0.0 master branch (as of now last commit was 753deb9), built with Stack 1.7.1 and stack-8.2.2.yaml
Steps to reproduce:
- Create a new stack project with "stack new test"
- Open the project folder with VSCode
- Open Main.hs from the app folder
- Change the end of line sequence for the file on the lower-right to CRLF
- Use the Format Document to format the whole file
- Select the line with the Main function's type and use Format Selection.
When using Format Document, an empty line is added after every line in the code, doubling the number of lines, while in the case of Format Selection, the line with the function's type is replaced with the "Import Lib" line.
Since by default VSCode on Windows 10 uses CRLF line endings for files created in it it is very easy to run into this issue although so far in my experience the workaround of changing this default to LF endings works perfectly, with both formatting options working as expected.