Skip to content

Commit 3d2a6a2

Browse files
committed
Minor formatting fixes to analyzers
1 parent 59a9f4a commit 3d2a6a2

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

src/CommunityToolkit.Mvvm.SourceGenerators/ComponentModel/ObservablePropertyGenerator.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
using CommunityToolkit.Mvvm.SourceGenerators.Helpers;
1010
using CommunityToolkit.Mvvm.SourceGenerators.Models;
1111
using Microsoft.CodeAnalysis;
12-
using Microsoft.CodeAnalysis.CSharp;
1312
using Microsoft.CodeAnalysis.CSharp.Syntax;
1413

1514
namespace CommunityToolkit.Mvvm.SourceGenerators;

src/CommunityToolkit.Mvvm.SourceGenerators/Diagnostics/Analyzers/InvalidPartialPropertyLevelObservablePropertyAttributeAnalyzer.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ public override void Initialize(AnalysisContext context)
6969
context.ReportDiagnostic(Diagnostic.Create(
7070
InvalidObservablePropertyDeclarationIsNotIncompletePartialDefinition,
7171
observablePropertyAttribute.GetLocation(),
72-
context.Symbol));
72+
propertySymbol.ContainingType,
73+
propertySymbol.Name));
7374
}
7475
}
7576

@@ -79,7 +80,8 @@ public override void Initialize(AnalysisContext context)
7980
context.ReportDiagnostic(Diagnostic.Create(
8081
InvalidObservablePropertyDeclarationReturnsByRef,
8182
observablePropertyAttribute.GetLocation(),
82-
context.Symbol));
83+
propertySymbol.ContainingType,
84+
propertySymbol.Name));
8385
}
8486

8587
// Emit an error if the property type is a ref struct
@@ -88,7 +90,8 @@ public override void Initialize(AnalysisContext context)
8890
context.ReportDiagnostic(Diagnostic.Create(
8991
InvalidObservablePropertyDeclarationReturnsRefLikeType,
9092
observablePropertyAttribute.GetLocation(),
91-
context.Symbol));
93+
propertySymbol.ContainingType,
94+
propertySymbol.Name));
9295
}
9396
}, SymbolKind.Property);
9497
});

src/CommunityToolkit.Mvvm.SourceGenerators/Diagnostics/Analyzers/InvalidPropertyLevelObservablePropertyAttributeAnalyzer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public override void Initialize(AnalysisContext context)
6060
InvalidPropertyDeclarationForObservableProperty,
6161
observablePropertyAttribute.GetLocation(),
6262
propertySymbol.ContainingType,
63-
propertySymbol));
63+
propertySymbol.Name));
6464
}
6565
}
6666
}, SymbolKind.Property);

src/CommunityToolkit.Mvvm.SourceGenerators/Diagnostics/Analyzers/UnsupportedRoslynVersionForPartialPropertyAnalyzer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public override void Initialize(AnalysisContext context)
5151
UnsupportedRoslynVersionForObservablePartialPropertySupport,
5252
propertySymbol.Locations.FirstOrDefault(),
5353
propertySymbol.ContainingType,
54-
propertySymbol));
54+
propertySymbol.Name));
5555
}
5656
}, SymbolKind.Property);
5757
});

0 commit comments

Comments
 (0)