|
27 | 27 | namespace Lucene.Net.CodeAnalysis.Dev.LuceneDev6xxx |
28 | 28 | { |
29 | 29 | [DiagnosticAnalyzer(LanguageNames.CSharp)] |
30 | | - public sealed class LuceneDev6001_StringComparisonAnalyzer : DiagnosticAnalyzer |
| 30 | + public sealed class LuceneDev6001_6002_StringComparisonAnalyzer : DiagnosticAnalyzer |
31 | 31 | { |
32 | 32 | private static readonly ImmutableHashSet<string> TargetMethodNames = |
33 | 33 | ImmutableHashSet.Create("StartsWith", "EndsWith", "IndexOf", "LastIndexOf"); |
34 | 34 |
|
35 | 35 | public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics |
36 | 36 | => ImmutableArray.Create( |
37 | 37 | Descriptors.LuceneDev6001_MissingStringComparison, |
38 | | - Descriptors.LuceneDev6001_InvalidStringComparison); |
| 38 | + Descriptors.LuceneDev6002_InvalidStringComparison); |
39 | 39 |
|
40 | 40 | public override void Initialize(AnalysisContext context) |
41 | 41 | { |
@@ -82,10 +82,10 @@ private static void AnalyzeInvocation(SyntaxNodeAnalysisContext ctx) |
82 | 82 |
|
83 | 83 | if (!hasStringComparisonArgForLiteral) |
84 | 84 | { |
85 | | - // safe to convert to char (6003), so skip 6001 reporting |
| 85 | + // Safe to convert to char (LuceneDev6005 handles it); skip 6001/6002 here. |
86 | 86 | return; |
87 | 87 | } |
88 | | - // else: has StringComparison -> do not skip; let 6001/6002 validate or codefix handle it |
| 88 | + // Has StringComparison -> do not skip; 6001/6002 validation continues. |
89 | 89 | } |
90 | 90 | } |
91 | 91 |
|
@@ -134,7 +134,7 @@ static bool HasStringComparisonParameter(IMethodSymbol? m, INamedTypeSymbol scTy |
134 | 134 | if (!isValidValue) |
135 | 135 | { |
136 | 136 | var diag = Diagnostic.Create( |
137 | | - Descriptors.LuceneDev6001_InvalidStringComparison, |
| 137 | + Descriptors.LuceneDev6002_InvalidStringComparison, |
138 | 138 | invalidArgLocation ?? memberAccess.Name.GetLocation(), |
139 | 139 | methodName, |
140 | 140 | comparisonValueName ?? "non-ordinal comparison"); |
@@ -174,7 +174,7 @@ static bool HasStringComparisonParameter(IMethodSymbol? m, INamedTypeSymbol scTy |
174 | 174 | if (!isValidValue) |
175 | 175 | { |
176 | 176 | var diag = Diagnostic.Create( |
177 | | - Descriptors.LuceneDev6001_InvalidStringComparison, |
| 177 | + Descriptors.LuceneDev6002_InvalidStringComparison, |
178 | 178 | invalidArgLocation ?? memberAccess.Name.GetLocation(), |
179 | 179 | methodName, |
180 | 180 | comparisonValueName ?? "non-ordinal comparison"); |
|
0 commit comments