Remove unnecessary extension

このコミットが含まれているのは:
Sergio Pedri committed 2022-10-29 15:57:55 +02:00
1 親 49791db39e
コミット c14dd305ae
2ファイル変更
+1 -20

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

@@ -27,7 +27,7 @@ public sealed class InvalidD2DResourceTextureIndexUseAnalyzer : DiagnosticAnalyz
{
IFieldSymbol fieldSymbol = (IFieldSymbol)context.Symbol;
if (fieldSymbol.HasAttributeWithFullyQualifiedName("ComputeSharp.D2D1.D2DResourceTextureIndexAttribute"))
if (fieldSymbol.TryGetAttributeWithFullMetadataName("ComputeSharp.D2D1.D2DResourceTextureIndexAttribute", out _))
{
string metadataName = fieldSymbol.Type.GetFullMetadataName();
-19
ファイルの表示
@@ -140,25 +140,6 @@ internal static class ISymbolExtensions
return $"{symbol.ContainingType.GetFullMetadataName()}.{symbol.Name}";
}
/// <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)
{
foreach (AttributeData attribute in symbol.GetAttributes())
{
if (attribute.AttributeClass?.HasFullyQualifiedName(name) == true)
{
return true;
}
}
return false;
}
/// <summary>
/// Tries to get an attribute with the specified full metadata name.
/// </summary>