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
Copy file name to clipboardExpand all lines: src/CommunityToolkit.Mvvm.SourceGenerators/Diagnostics/Analyzers/ClassUsingAttributeInsteadOfInheritanceAnalyzer.cs
Copy file name to clipboardExpand all lines: src/CommunityToolkit.Mvvm.SourceGenerators/Diagnostics/Analyzers/FieldReferenceForObservablePropertyFieldAnalyzer.cs
+44-36Lines changed: 44 additions & 36 deletions
Original file line number
Diff line number
Diff line change
@@ -35,51 +35,59 @@ public override void Initialize(AnalysisContext context)
if(context.Compilation.GetTypeByMetadataName("CommunityToolkit.Mvvm.ComponentModel.ObservablePropertyAttribute")is not INamedTypeSymbolobservablePropertySymbol)
46
42
{
47
43
return;
48
44
}
49
45
50
-
// Special case field references from within a constructor and don't ever emit warnings for them. The point of this
51
-
// analyzer is to prevent mistakes when users assign a field instead of a property and then get confused when the
52
-
// property changed event is not raised. But this would never be the case from a constructur anyway, given that
53
-
// no handler for that event would possibly be present. Suppressing warnings in this cases though will help to
54
-
// avoid scenarios where people get nullability warnings they cannot suppress, in case they were pushed by the
55
-
// analyzer in the MVVM Toolkit to not assign a field marked with a non-nullable reference type. Ideally this
56
-
// would be solved by habing the generated setter be marked with [MemberNotNullIfNotNull("field", "value")],
57
-
// but such an annotation does not currently exist.
Copy file name to clipboardExpand all lines: src/CommunityToolkit.Mvvm.SourceGenerators/Diagnostics/Analyzers/FieldWithOrphanedDependentObservablePropertyAttributesAnalyzer.cs
+15-5Lines changed: 15 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,19 @@ public override void Initialize(AnalysisContext context)
// We also need the symbol for [ObservableProperty], separately
58
+
if(context.Compilation.GetTypeByMetadataName("CommunityToolkit.Mvvm.ComponentModel.ObservablePropertyAttribute")is not INamedTypeSymbolobservablePropertySymbol)
Copy file name to clipboardExpand all lines: src/CommunityToolkit.Mvvm.SourceGenerators/Diagnostics/Analyzers/InvalidClassLevelNotifyPropertyChangedRecipientsAttributeAnalyzer.cs
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ public override void Initialize(AnalysisContext context)
44
44
return;
45
45
}
46
46
47
-
// Emit a diagnstic for types that use [NotifyPropertyChangedRecipients] but are neither inheriting from ObservableRecipient nor using [ObservableRecipient]
47
+
// Emit a diagnostic for types that use [NotifyPropertyChangedRecipients] but are neither inheriting from ObservableRecipient nor using [ObservableRecipient]
Copy file name to clipboardExpand all lines: src/CommunityToolkit.Mvvm.SourceGenerators/Diagnostics/Analyzers/UnsupportedCSharpLanguageVersionAnalyzer.cs
+9-6Lines changed: 9 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,13 @@ public override void Initialize(AnalysisContext context)
0 commit comments