You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Parser adds new line symbol to the source being parsed #3617
@auduchinok Could you give more context on why this is a problem
Context I know is
New line is only added if the file doesn't already end in a new line
This applies only to ParseAndCheckFileInProject and ParseFileInProject
But I don't know what specific problems it causes to add the new line character. Equally, I don't know why our tests are so sensitive to the character being there (beyond line number range reports - it's more dramatic than that I believe?)
@dsyme Adding a new line changes AST ranges which we rely on. We currently map these ranges to R# document offsets using approach very similar to the one used in RoslynHelpers.fs except getting min of lines count and a range line. It works fine when an empty line isn't added to the source and leads to ArgumentOutOfRangeException otherwise.
Activity
dsyme commentedon Sep 20, 2017
@auduchinok Could you give more context on why this is a problem
Context I know is
But I don't know what specific problems it causes to add the new line character. Equally, I don't know why our tests are so sensitive to the character being there (beyond line number range reports - it's more dramatic than that I believe?)
Thanks!
don
auduchinok commentedon Sep 20, 2017
@dsyme Adding a new line changes AST ranges which we rely on. We currently map these ranges to R# document offsets using approach very similar to the one used in RoslynHelpers.fs except getting min of lines count and a range line. It works fine when an empty line isn't added to the source and leads to
ArgumentOutOfRangeExceptionotherwise.dsyme commentedon Sep 20, 2017
@auduchinok OK thanks, that makes sense
dsyme commentedon Sep 20, 2017
@auduchinok I'm labelling this a "Urgency Later" since we workaround it at the moment, but please feel free to submit a fix for it.
auduchinok commentedon Jun 19, 2020
Fixed in #6001.