-
Notifications
You must be signed in to change notification settings - Fork 198
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
Ensure we include the line count and end char index in remapped spans #9863
Ensure we include the line count and end char index in remapped spans #9863
Conversation
@dotnet/razor-compiler for reviews. /cc @ryzngard |
@@ -564,7 +564,7 @@ private static SourceSpan RemapFilePathIfNecessary(SourceSpan sourceSpan, CodeRe | |||
// If you try and use the line pragma in the design time docs to map back to the original file it will fail, | |||
// as the path isn't actually valid on windows. As a workaround we apply a simple heuristic to switch the | |||
// paths back when writing out the design time paths. | |||
sourceSpan = new SourceSpan(sourceSpan.FilePath.Replace("/", "\\"), sourceSpan.AbsoluteIndex, sourceSpan.LineIndex, sourceSpan.CharacterIndex, sourceSpan.Length); | |||
sourceSpan = new SourceSpan(sourceSpan.FilePath.Replace("/", "\\"), sourceSpan.AbsoluteIndex, sourceSpan.LineIndex, sourceSpan.CharacterIndex, sourceSpan.Length, sourceSpan.LineCount, sourceSpan.EndCharacterIndex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we have a test for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do have tests, but they were all at the start of the doc so the baseline didn't actually change. I'll add a test that covers it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated test
@jaredpar for any other feedback |
…dotnet#9863) * Ensure we include the line count and end char index in remapped spans * Make the source span in tests have non-default values to ensure they get mapped too
Ensure we include the line count and end char index in remapped spans
Fixes #9827