You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -452,16 +454,28 @@ private static bool TryGetIsNotifyingRecipients(IFieldSymbol fieldSymbol, out bo
452
454
/// <param name="fieldSymbol">The input <see cref="IFieldSymbol"/> instance to process.</param>
453
455
/// <param name="attributeData">The <see cref="AttributeData"/> instance for <paramref name="fieldSymbol"/>.</param>
454
456
/// <param name="diagnostics">The current collection of gathered diagnostics.</param>
457
+
/// <param name="hasOrInheritsClassLevelNotifyRecipients">Indicates wether the containing type of <paramref name="fieldSymbol"/> has or inherits <c>[NotifyRecipients]</c>.</param>
455
458
/// <param name="isBroadcastTargetValid">Whether or not the the property is in a valid target that can notify recipients.</param>
456
459
/// <returns>Whether or not the generated property for <paramref name="fieldSymbol"/> used <c>[NotifyRecipients]</c>.</returns>
Copy file name to clipboardExpand all lines: CommunityToolkit.Mvvm.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -459,4 +459,20 @@ internal static class DiagnosticDescriptors
459
459
isEnabledByDefault:true,
460
460
description:"Types annotated with [NotifyDataErrorInfo] must inherit from ObservableRecipient.",
461
461
helpLinkUri:"https://aka.ms/mvvmtoolkit");
462
+
463
+
/// <summary>
464
+
/// Gets a <see cref="DiagnosticDescriptor"/> indicating when <c>[NotifyRecipients]</c> is applied to a field in a class with <c>[NotifyRecipients]</c> used at the class-level.
465
+
/// <para>
466
+
/// Format: <c>"The field {0}.{1} is annotated with [NotifyRecipients], but that is not needed since its containing type already uses or inherits [NotifyRecipients] at the class-level"</c>.
title:"Unnecessary [NotifyRecipients] field annotation",
472
+
messageFormat:"The field {0}.{1} is annotated with [NotifyRecipients], but that is not needed since its containing type already uses or inherits [NotifyRecipients] at the class-level",
description:"Annotating a field with [NotifyRecipients] is not necessary if the containing type has or inherits [NotifyRecipients] at the class-level.",
0 commit comments