Allow newlines in the holes inside interpolated strings#56853
Allow newlines in the holes inside interpolated strings#56853CyrusNajmabadi merged 21 commits intodotnet:mainfrom
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.
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.
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.
view PR with whitespace changes off.
|
@chsienki PTAL. Thanks! :) |
chsienki
left a comment
There was a problem hiding this comment.
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.
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.
Co-authored-by: Julien Couvreur <jcouv@users.noreply.github.com>
jcouv
left a comment
There was a problem hiding this comment.
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