C#: Extract alignment and format clauses of string interpolation expressions.

This commit is contained in:
Michael Nebel
2025-03-20 15:18:19 +01:00
parent 179bae8791
commit af6e1bda4c
9 changed files with 104 additions and 22 deletions

View File

@@ -29,6 +29,15 @@ namespace Semmle.Extraction.CSharp
symbol is null ? (AnnotatedTypeSymbol?)null : new AnnotatedTypeSymbol(symbol, NullableAnnotation.None);
}
internal static class AnnotatedTypeSymbolExtensions
{
/// <summary>
/// Returns true if the type is a string type.
/// </summary>
public static bool IsStringType(this AnnotatedTypeSymbol? type) =>
type.HasValue && type.Value.Symbol?.SpecialType == SpecialType.System_String;
}
internal static class SymbolExtensions
{
/// <summary>