Add unit tests for new analyzer diagnostics
このコミットが含まれているのは:
1 親
0bb328f14b
コミット
afe8e1d93a
4ファイル変更
+127
-4
検索条件に一致するファイルはありません
+6
@@ -37,6 +37,12 @@ public sealed class InvalidGeneratedCanvasEffectPropertyAccessorsAnalyzer : Diag
|
||||
return;
|
||||
}
|
||||
|
||||
// Skip implementation parts to avoid duplicate errors
|
||||
if (context.Symbol is IPropertySymbol { PartialDefinitionPart: not null })
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// If the property is using [GeneratedCanvasEffectProperty], emit the diagnostic
|
||||
if (context.Symbol.TryGetAttributeWithType(generatedCanvasEffectPropertyAttributeSymbol, out AttributeData? generatedCanvasEffectPropertyAttribute))
|
||||
{
|
||||
|
||||
+2
-2
@@ -32,8 +32,8 @@ public sealed class InvalidGeneratedCanvasEffectPropertyContainingTypeAnalyzer :
|
||||
|
||||
context.RegisterSymbolAction(context =>
|
||||
{
|
||||
// Validate that we have a valid containing type
|
||||
if (context.Symbol is not IPropertySymbol { ContainingType: { } containingTypeSymbol })
|
||||
// Validate that we have a valid containing type (also skip implementation parts)
|
||||
if (context.Symbol is not IPropertySymbol { ContainingType: { } containingTypeSymbol, PartialDefinitionPart: null })
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
+2
-2
@@ -37,8 +37,8 @@ public sealed class InvalidGeneratedCanvasEffectPropertyDeclarationAnalyzer : Di
|
||||
|
||||
context.RegisterSymbolAction(context =>
|
||||
{
|
||||
// Ensure that we have some target property to analyze
|
||||
if (context.Symbol is not IPropertySymbol propertySymbol)
|
||||
// Ensure that we have some target property to analyze (also skip implementation parts)
|
||||
if (context.Symbol is not IPropertySymbol { PartialDefinitionPart: null } propertySymbol)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする