33using System . Collections . Generic ;
44using System . Collections . Immutable ;
55using System . Linq ;
6+ using CustomCode_Analyzer . Helpers ;
67using Microsoft . CodeAnalysis ;
78using Microsoft . CodeAnalysis . CSharp . Syntax ;
89using Microsoft . CodeAnalysis . Diagnostics ;
910using Microsoft . CodeAnalysis . Text ;
10- using static CustomCode_Analyzer . AttributeNames ;
11+ using static CustomCode_Analyzer . Helpers . AttributeNames ;
1112
1213namespace CustomCode_Analyzer
1314{
@@ -349,7 +350,7 @@ public static class Categories
349350 /// Returns the full set of DiagnosticDescriptors that this analyzer is capable of producing.
350351 /// </summary>
351352 public override ImmutableArray < DiagnosticDescriptor > SupportedDiagnostics =>
352- ImmutableArray . Create (
353+ [
353354 NonPublicInterfaceRule ,
354355 NoSingleInterfaceRule ,
355356 ManyInterfacesRule ,
@@ -373,8 +374,8 @@ public static class Categories
373374 UnsupportedParameterTypeRule ,
374375 UnsupportedDefaultValueRule ,
375376 PotentialStatefulImplementationRule ,
376- InputSizeLimitRule
377- ) ;
377+ InputSizeLimitRule ,
378+ ] ;
378379
379380 /// <summary>
380381 /// Entry point for the analyzer. Initializes analysis by setting up compilation-level
@@ -1151,12 +1152,12 @@ is InterfaceDeclarationSyntax ifDecl
11511152 // Create a comma-separated list of interface names
11521153 var interfaceNames = string . Join ( ", " , osInterfaces . Keys . OrderBy ( n => n ) ) ;
11531154 // Report diagnostic indicating multiple OSInterfaces
1154- foreach ( var osInterface in osInterfaces . Values )
1155+ foreach ( var ( Syntax , Symbol ) in osInterfaces . Values )
11551156 {
11561157 context . ReportDiagnostic (
11571158 Diagnostic . Create (
11581159 ManyInterfacesRule ,
1159- osInterface . Syntax . Identifier . GetLocation ( ) ,
1160+ Syntax . Identifier . GetLocation ( ) ,
11601161 interfaceNames
11611162 )
11621163 ) ;
@@ -1216,9 +1217,7 @@ is InterfaceDeclarationSyntax ifDecl
12161217 t => t . TypeKind == TypeKind . Struct && HasAttribute ( t , OSStructureAttributeNames )
12171218 ) ;
12181219
1219- #pragma warning disable RS1024
12201220 var duplicates = allStructures . GroupBy ( x => x . Name ) . Where ( g => g . Count ( ) > 1 ) ;
1221- #pragma warning restore RS1024
12221221
12231222 foreach ( var duplicate in duplicates )
12241223 {
@@ -1296,16 +1295,16 @@ Func<INamedTypeSymbol, bool> predicate
12961295 /// Anything not in this set (and is not null for reference types) is considered invalid.
12971296 /// </summary>
12981297 private static readonly ImmutableHashSet < SpecialType > ValidParameterSpecialTypes =
1299- ImmutableHashSet . Create (
1300- SpecialType . System_String ,
1301- SpecialType . System_Int32 ,
1302- SpecialType . System_Int64 ,
1303- SpecialType . System_Single ,
1304- SpecialType . System_Double ,
1305- SpecialType . System_Decimal ,
1306- SpecialType . System_Boolean ,
1307- SpecialType . System_DateTime
1308- ) ;
1298+ [
1299+ SpecialType . System_String ,
1300+ SpecialType . System_Int32 ,
1301+ SpecialType . System_Int64 ,
1302+ SpecialType . System_Single ,
1303+ SpecialType . System_Double ,
1304+ SpecialType . System_Decimal ,
1305+ SpecialType . System_Boolean ,
1306+ SpecialType . System_DateTime ,
1307+ ] ;
13091308
13101309 /// <summary>
13111310 /// Checks whether a parameter's default value is a compile-time constant of a supported type.
0 commit comments