Add InvalidEffectIdValueAnalyzer

このコミットが含まれているのは:
Sergio Pedri committed 2023-09-27 14:04:04 +02:00
1 親 37fee87489
コミット 8cbb3c958e
4ファイル変更
+96 -1

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

+15
ファイルの表示
@@ -8,6 +8,21 @@ namespace ComputeSharp.SourceGeneration.Extensions;
/// </summary>
internal static class AttributeDataExtensions
{
/// <summary>
/// Tries to get the location of the input <see cref="AttributeData"/> instance.
/// </summary>
/// <param name="attributeData">The input <see cref="AttributeData"/> instance to get the location for.</param>
/// <returns>The resulting location for <paramref name="attributeData"/>, if a syntax reference is available.</returns>
public static Location? GetLocation(this AttributeData attributeData)
{
if (attributeData.ApplicationSyntaxReference is { } syntaxReference)
{
return syntaxReference.SyntaxTree.GetLocation(syntaxReference.Span);
}
return null;
}
/// <summary>
/// Tries to get a constructor argument at a given index from the input <see cref="AttributeData"/> instance.
/// </summary>