Add MissingPixelShaderDescriptorOnPixelShaderAnalyzer
このコミットが含まれているのは:
1 親
933dca22ed
コミット
821bc6ba0d
5ファイル変更
+114
検索条件に一致するファイルはありません
@@ -27,6 +27,17 @@ internal static class ISymbolExtensions
|
||||
return symbol.ToDisplayString(FullyQualifiedWithoutGlobalFormat);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether or not a given symbol has an attribute with the specified type.
|
||||
/// </summary>
|
||||
/// <param name="symbol">The input <see cref="ISymbol"/> instance to check.</param>
|
||||
/// <param name="typeSymbol">The <see cref="ITypeSymbol"/> instance for the attribute type to look for.</param>
|
||||
/// <returns>Whether or not <paramref name="symbol"/> has an attribute with the specified type.</returns>
|
||||
public static bool HasAttributeWithType(this ISymbol symbol, ITypeSymbol typeSymbol)
|
||||
{
|
||||
return TryGetAttributeWithType(symbol, typeSymbol, out _);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tries to get an attribute with the specified type.
|
||||
/// </summary>
|
||||
|
||||
@@ -24,6 +24,25 @@ internal static class ITypeSymbolExtensions
|
||||
return builder.WrittenSpan.SequenceEqual(name.AsSpan());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether or not a given <see cref="ITypeSymbol"/> implements an interface of a specified type.
|
||||
/// </summary>
|
||||
/// <param name="typeSymbol">The target <see cref="ITypeSymbol"/> instance to check.</param>
|
||||
/// <param name="interfaceSymbol">The <see cref="ITypeSymbol"/> instane to check for inheritance from.</param>
|
||||
/// <returns>Whether or not <paramref name="typeSymbol"/> has an interface of type <paramref name="interfaceSymbol"/>.</returns>
|
||||
public static bool HasInterfaceWithType(this ITypeSymbol typeSymbol, ITypeSymbol interfaceSymbol)
|
||||
{
|
||||
foreach (INamedTypeSymbol interfaceType in typeSymbol.AllInterfaces)
|
||||
{
|
||||
if (SymbolEqualityComparer.Default.Equals(interfaceType, interfaceSymbol))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the fully qualified metadata name for a given <see cref="ITypeSymbol"/> instance.
|
||||
/// </summary>
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする