-
Notifications
You must be signed in to change notification settings - Fork 212
Add missing paren to SyntaxSerializer #11968
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
Conversation
@@ -105,7 +105,7 @@ private void WriteNode(SyntaxNode node) | |||
|
|||
protected virtual void WriteSpan(TextSpan span) | |||
{ | |||
WriteValue($"[{span.Start}..{span.End}{Separator}Width: {span.End - span.Start}"); | |||
WriteValue($"[{span.Start}..{span.End}){Separator}Width: {span.End - span.Start}"); |
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.
Did you mean this?
WriteValue($"[{span.Start}..{span.End}){Separator}Width: {span.End - span.Start}"); | |
WriteValue($"[{span.Start}..{span.End}]{Separator}Width: {span.End - span.Start}"); |
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.
No, the end is exclusive. I think we use [x..y)
to demonstrate that in other places as well. Definitely we did that here previously:
razor/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Syntax/SyntaxSerializer.cs
Line 136 in 97c4952
Write($"[{node.Position}..{node.EndPosition})"); |
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.
Oh right, thanks. Looked weird out of context
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.
Thanks! I'm glad this has no product impact, since it's only used for debugging. Thankfully, I got it right in TestSyntaxSerializer
. Sadly, this is one of the places where the serialization differs between debugging and test output.
The paren seems to be unintentionally dropped in #11853 cc @DustinCampbell