File tree Expand file tree Collapse file tree
EditorFeatures/TestUtilities/Diagnostics/NamingStyles
Workspaces/Core/Portable/NamingStyles Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -109,12 +109,14 @@ private NamingStylePreferences FieldNamesAreCamelCaseOption()
109109 prefix : "" ,
110110 suffix : "" ,
111111 wordSeparator : "" ) ;
112+
112113 var namingRule = new SerializableNamingRule ( )
113114 {
114115 SymbolSpecificationID = symbolSpecification . ID ,
115116 NamingStyleID = namingStyle . ID ,
116117 EnforcementLevel = DiagnosticSeverity . Error
117118 } ;
119+
118120 var info = new NamingStylePreferences (
119121 ImmutableArray . Create ( symbolSpecification ) ,
120122 ImmutableArray . Create ( namingStyle ) ,
@@ -139,12 +141,14 @@ private NamingStylePreferences FieldNamesAreCamelCaseWithUnderscoreOption()
139141 prefix : "_" ,
140142 suffix : "" ,
141143 wordSeparator : "" ) ;
144+
142145 var namingRule = new SerializableNamingRule ( )
143146 {
144147 SymbolSpecificationID = symbolSpecification . ID ,
145148 NamingStyleID = namingStyle . ID ,
146149 EnforcementLevel = DiagnosticSeverity . Error
147150 } ;
151+
148152 var info = new NamingStylePreferences (
149153 ImmutableArray . Create ( symbolSpecification ) ,
150154 ImmutableArray . Create ( namingStyle ) ,
Original file line number Diff line number Diff line change @@ -328,14 +328,14 @@ private string CreateCompliantNameReusingPartialPrefixesAndSuffixes(string name)
328328 private static string StripCommonPrefixes ( string name )
329329 {
330330 var index = 0 ;
331- while ( name . Length > index + 1 )
331+ while ( index + 1 < name . Length )
332332 {
333333 switch ( char . ToLowerInvariant ( name [ index ] ) )
334334 {
335335 case 'm' :
336336 case 's' :
337337 case 't' :
338- if ( name . Length > index + 2 && name [ index + 1 ] == '_' )
338+ if ( index + 2 < name . Length && name [ index + 1 ] == '_' )
339339 {
340340 index += 2 ;
341341 continue ;
You can’t perform that action at this time.
0 commit comments