-
Notifications
You must be signed in to change notification settings - Fork 226
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
Support new C#11 string types in CopyPasteTokenAnalyzer and TokenTypeAnalyzer #6204
The head ref may contain hidden characters: "\u010Daba/raw-string-literal-token"
Support new C#11 string types in CopyPasteTokenAnalyzer and TokenTypeAnalyzer #6204
Conversation
3311a61
to
9979b3d
Compare
@@ -40,7 +41,13 @@ protected override string GetCpdValue(SyntaxToken token) | |||
{ | |||
return "$num"; | |||
} | |||
else if (token.IsAnyKind(SyntaxKind.StringLiteralToken, SyntaxKind.InterpolatedStringTextToken)) | |||
else if (token.IsAnyKind(SyntaxKind.StringLiteralToken, | |||
SyntaxKind.InterpolatedStringTextToken, |
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.
I see that we subscribe here to InterpolatedStringTextToken
but the following are missing:
InterpolatedSingleLineRawStringStartToken
InterpolatedMultiLineRawStringStartToken
They are not needed?
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, we only want to replace the "body" of the string with the $str. and not also the being and and tokens.
public void Aaa() | ||
{ | ||
var x = 42; | ||
var interpolatedWithWhitespaceToken = $"This literal should be $str but the whitespace between interpolation will not: {x} {x}"; |
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.
944b5dd
to
b2b856e
Compare
Kudos, SonarCloud Quality Gate passed! |
Kudos, SonarCloud Quality Gate passed! |
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!
No description provided.