-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Allow newlines in the holes inside interpolated strings #56853
Allow newlines in the holes inside interpolated strings #56853
Conversation
It looks like the PR doesn't include any modified or new tests. Are those coming as part of this PR? |
Diagnostic(ErrorCode.ERR_NewlinesAreNotAllowedInsideANonVerbatimInterpolatedString, "").WithLocation(5, 77), | ||
// (7,2): error CS1035: End-of-file found, '*/' expected | ||
// } | ||
Diagnostic(ErrorCode.ERR_OpenEndedComment, "").WithLocation(7, 2), |
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.
getting a duplicated error. investigating. #Closed
@RikkiGibson yes. lots of test updates here :) |
Azure Pipelines successfully started running 3 pipeline(s). |
Note: i still need to make the specification change doc on this. |
Kindly reminder to document the feature (with link to test plan and spec) in https://github.com/dotnet/roslyn/blob/main/docs/Language%20Feature%20Status.md In reply to: 943600359 |
{ | ||
var text = node.SyntaxTree.GetText(); | ||
if (text.Lines.GetLineFromPosition(interpolation.OpenBraceToken.SpanStart).LineNumber != | ||
text.Lines.GetLineFromPosition(interpolation.CloseBraceToken.SpanStart).LineNumber) |
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.
note: i can also do this by just walking the tree. up to you if want me to go that route or not. this is def the easiest and most fool proof mechanism to determine this though.
@@ -137,7 +137,7 @@ private ExpressionSyntax ParseInterpolatedStringToken() | |||
} |
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.
view PR with whitespace changes off.
@chsienki PTAL. Thanks! :) |
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.
LGTM minus a couple of spelling nits
Co-authored-by: Chris Sienkiewicz <chsienki@microsoft.com>
Co-authored-by: Chris Sienkiewicz <chsienki@microsoft.com>
Co-authored-by: Chris Sienkiewicz <chsienki@microsoft.com>
e316868
to
65e91b2
Compare
As this just touched comments/loc-string, i made the chnage and set to auto-merge. LMK if there's an issue with that. |
text.Lines.GetLineFromPosition(interpolation.CloseBraceToken.SpanStart).LineNumber) | ||
{ | ||
diagnostics.Add( | ||
ErrorCode.ERR_NewlinesAreNotAllowedInsideANonVerbatimInterpolatedString, |
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.
Just remembered... We'll need to add this error code the the UpgradeProject fixer. That's the fixer that handles diagnostics that include a CSharpRequiredLanguageVersion
.
This can be tracked by a follow-up issue.
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.
sure.
Co-authored-by: Julien Couvreur <jcouv@users.noreply.github.com>
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.
LGTM Thanks (iteration 21). IDE portion can be a follow-up
… implemented as part of dotnet#50799 and later realized via dotnet#56853
Fixes dotnet/csharplang#4935 (approved by LDM).
Review with whitespace changes off.
Relates to test plan #57154