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/Thinktecture.Runtime.Extensions.SourceGenerator/CodeAnalysis/Diagnostics/ThinktectureRuntimeExtensionsAnalyzer.cs
Copy file name to clipboardExpand all lines: src/Thinktecture.Runtime.Extensions.SourceGenerator/CodeAnalysis/DiagnosticsDescriptors.cs
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -48,5 +48,5 @@ internal static class DiagnosticsDescriptors
48
48
publicstaticreadonlyDiagnosticDescriptorStaticPropertiesAreNotConsideredItems=new("TTRESG101","Static properties are not considered enumeration items, use a field instead","The static property '{0}' is not considered a enumeration item, use a field instead",nameof(ThinktectureRuntimeExtensionsAnalyzer),DiagnosticSeverity.Warning,true);
49
49
publicstaticreadonlyDiagnosticDescriptorExplicitComparerWithoutEqualityComparer=new("TTRESG102","The type has a comparer defined but no equality comparer","The type '{0}' has a comparer defined but no equality comparer",nameof(ThinktectureRuntimeExtensionsAnalyzer),DiagnosticSeverity.Warning,true);
50
50
publicstaticreadonlyDiagnosticDescriptorExplicitEqualityComparerWithoutComparer=new("TTRESG103","The type has an equality comparer defined but no comparer","The type '{0}' has an equality comparer defined but no comparer",nameof(ThinktectureRuntimeExtensionsAnalyzer),DiagnosticSeverity.Warning,true);
51
-
publicstaticreadonlyDiagnosticDescriptorMembersDisallowingDefaultValuesMustBeRequired=new("TTRESG104","The member must be marked as 'required' to ensure proper initialization","The {0} '{1}' must be marked as 'required' to ensure proper initialization",nameof(ThinktectureRuntimeExtensionsAnalyzer),DiagnosticSeverity.Warning,true);
51
+
publicstaticreadonlyDiagnosticDescriptorMembersDisallowingDefaultValuesMustBeRequired=new("TTRESG104","The member must be marked as 'required' to ensure proper initialization","The {0} '{1}' of type '{2}' must be marked as 'required' to ensure proper initialization",nameof(ThinktectureRuntimeExtensionsAnalyzer),DiagnosticSeverity.Warning,true);
Copy file name to clipboardExpand all lines: test/Thinktecture.Runtime.Extensions.SourceGenerator.Tests/AnalyzerAndCodeFixTests/TTRESG104_MembersDisallowingDefaultValuesMustBeRequired.cs
+14-11Lines changed: 14 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -10,16 +10,19 @@ public class TTRESG104_MembersDisallowingDefaultValuesMustBeRequired
10
10
privateconststring_DIAGNOSTIC_ID="TTRESG104";
11
11
12
12
[Theory]
13
-
[InlineData("field","IntBasedStructValueObjectDoesNotAllowDefaultStructs Member;")]// field: non-readonly VO
14
-
[InlineData("field","StructStringEnum Member;")]// field: non-readonly SE
15
-
[InlineData("field","TestUnion_struct_string_int Member;")]// field: non-readonly DU
16
-
[InlineData("property","StructStringEnum Member { get; set; }")]// property: non-readonly SE
17
-
[InlineData("property","IntBasedStructValueObjectDoesNotAllowDefaultStructs Member { get; set; }")]// property: non-readonly VO
18
-
[InlineData("property","TestUnion_struct_string_int Member { get; set; }")]// property: non-readonly VO
19
-
[InlineData("property","IntBasedStructValueObjectDoesNotAllowDefaultStructs Member { get; init; }")]// property: non-readonly with init
20
-
[InlineData("property","IntBasedStructValueObjectDoesNotAllowDefaultStructs Member { set { } }")]// property: setter only
21
-
[InlineData("property","abstract IntBasedStructValueObjectDoesNotAllowDefaultStructs Member { get; set; }")]// property: setter only
[InlineData("field","IntBasedStructValueObjectDoesNotAllowDefaultStructs","IntBasedStructValueObjectDoesNotAllowDefaultStructs Member;")]// field: non-readonly VO
14
+
[InlineData("field","StructStringEnum","StructStringEnum Member;")]// field: non-readonly SE
15
+
[InlineData("field","TestUnion_struct_string_int","TestUnion_struct_string_int Member;")]// field: non-readonly DU
16
+
[InlineData("property","StructStringEnum","StructStringEnum Member { get; set; }")]// property: non-readonly SE
17
+
[InlineData("property","IntBasedStructValueObjectDoesNotAllowDefaultStructs","IntBasedStructValueObjectDoesNotAllowDefaultStructs Member { get; set; }")]// property: non-readonly VO
18
+
[InlineData("property","TestUnion_struct_string_int","TestUnion_struct_string_int Member { get; set; }")]// property: non-readonly VO
19
+
[InlineData("property","IntBasedStructValueObjectDoesNotAllowDefaultStructs","IntBasedStructValueObjectDoesNotAllowDefaultStructs Member { get; init; }")]// property: non-readonly with init
20
+
[InlineData("property","IntBasedStructValueObjectDoesNotAllowDefaultStructs","IntBasedStructValueObjectDoesNotAllowDefaultStructs Member { set { } }")]// property: setter only
21
+
[InlineData("property","IntBasedStructValueObjectDoesNotAllowDefaultStructs","abstract IntBasedStructValueObjectDoesNotAllowDefaultStructs Member { get; set; }")]// property: abstract
0 commit comments