Skip to content
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

RCS1262 CodeFix doesn't take into account repeated $ characters in interpolated raw strings #1337

Closed
prettybits opened this issue Dec 11, 2023 · 0 comments · Fixed by #1339
Closed

Comments

@prettybits
Copy link

Product and Version Used: Roslynator.Analyzers v4.7.0

Steps to Reproduce: Define a string variable as an interpolated raw string using 2 or more $ characters in front, with a corresponding number of curly braces around the interpolation expressions, e.g.

var interpolatedRaw = $$"""{{someVariable}}{@m}""";

This is correctly detected as not needing to be a raw string, but the CodeFix produces invalid code:

Actual Behavior:

var interpolatedRaw = $"{{someVariable}}{@m}";

Expected Behavior:

var interpolatedRaw = $"{someVariable}{{@m}}";

I'm creating these kinds of strings for ExpressionTemplates of Serilog.Expressions, and using interpolated raw strings was how I had specified these so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants