dotnet/roslyn-sdk

Cannot use raw interpolated string with multiple dollar signs in test code

reduckted opened this issue · 1 comments

I'm trying to test an analyzer by using test code that looks like this:

int number = 1;
string text = $$"""raw string {{number}}""";

Unfortunately, the $$ is interpreted as a position marker, so the test code that ends up being used is:

int number = 1;
string text = """raw string {{number}}""";

Is there a way to escape a position marker?

No, but you can disable markup for a specific test by setting MarkupMode to None.