Closed
Description
We use StringReader.ReadLine()
to read in a file for the first time here:
PowerShellEditorServices/src/PowerShellEditorServices/Workspace/ScriptFile.cs
Lines 224 to 237 in 042f2e0
However, this has the nasty habit of dropping newlines at the ends of files. See https://github.com/dotnet/corefx/issues/32990.
This causes off-by-one errors in all these files for us. But since this behaviour is in both .NET Framework and Core, it's probably permanent. So we just need to use something else.
In the above corefx issue, I summarised different string split methods, and think we should either use String.Split()
or do it ourselves, depending on what we think is best suited to our needs.