Add diagnostics for invalid [D2DResourceTextureIndex] uses

このコミットが含まれているのは:
Sergio Pedri committed 2022-08-08 15:45:45 +02:00
1 親 fdc69ed292
コミット a3635b09d9
5ファイル変更
+76

検索条件に一致するファイルはありません

+21
ファイルの表示
@@ -134,6 +134,27 @@ internal static class ISymbolExtensions
return symbol.GetFullMetadataName().Replace('`', '-').Replace('+', '.');
}
/// <summary>
/// Checks whether or not a given symbol has an attribute with the specified full name.
/// </summary>
/// <param name="symbol">The input <see cref="ISymbol"/> instance to check.</param>
/// <param name="name">The attribute name to look for.</param>
/// <returns>Whether or not <paramref name="symbol"/> has an attribute with the specified name.</returns>
public static bool HasAttributeWithFullyQualifiedName(this ISymbol symbol, string name)
{
ImmutableArray<AttributeData> attributes = symbol.GetAttributes();
foreach (AttributeData attribute in attributes)
{
if (attribute.AttributeClass?.HasFullyQualifiedName(name) == true)
{
return true;
}
}
return false;
}
/// <summary>
/// Tries to get an attribute with the specified full metadata name.
/// </summary>