mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
C#: Extract the ValueText instead of Text for interpolated string literals as this contains the value after eg. indentation processing.
This commit is contained in:
@@ -27,7 +27,7 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
|
||||
case SyntaxKind.InterpolatedStringText:
|
||||
// Create a string literal
|
||||
var interpolatedText = (InterpolatedStringTextSyntax)c;
|
||||
new Expression(new ExpressionInfo(Context, Type, Context.CreateLocation(c.GetLocation()), ExprKind.STRING_LITERAL, this, child++, false, interpolatedText.TextToken.Text));
|
||||
new Expression(new ExpressionInfo(Context, Type, Context.CreateLocation(c.GetLocation()), ExprKind.STRING_LITERAL, this, child++, false, interpolatedText.TextToken.ValueText));
|
||||
break;
|
||||
default:
|
||||
throw new InternalError(c, $"Unhandled interpolation kind {c.Kind()}");
|
||||
|
||||
Reference in New Issue
Block a user