Skip to content

Commit 409f5c9

Browse files
committed
C#: Extract the ValueText instead of Text for interpolated string literals as this contains the value after eg. indentation processing.
1 parent 29b4cd5 commit 409f5c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

csharp/extractor/Semmle.Extraction.CSharp/Entities/Expressions/InterpolatedString.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ protected override void PopulateExpression(TextWriter trapFile)
2727
case SyntaxKind.InterpolatedStringText:
2828
// Create a string literal
2929
var interpolatedText = (InterpolatedStringTextSyntax)c;
30-
new Expression(new ExpressionInfo(Context, Type, Context.CreateLocation(c.GetLocation()), ExprKind.STRING_LITERAL, this, child++, false, interpolatedText.TextToken.Text));
30+
new Expression(new ExpressionInfo(Context, Type, Context.CreateLocation(c.GetLocation()), ExprKind.STRING_LITERAL, this, child++, false, interpolatedText.TextToken.ValueText));
3131
break;
3232
default:
3333
throw new InternalError(c, $"Unhandled interpolation kind {c.Kind()}");

0 commit comments

Comments
 (0)