Skip to content

Commit 2a1f6b8

Browse files
Ignore case since it's coming from visual basic
(OK it's just for consistency on the underscore)
1 parent ceb4706 commit 2a1f6b8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ICSharpCode.CodeConverter/CSharp/CommonConversions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,13 +280,13 @@ public SyntaxToken ConvertIdentifier(SyntaxToken id, bool isAttribute = false)
280280
if (symbol != null && !string.IsNullOrWhiteSpace(symbol.Name)) {
281281
if (symbol.IsConstructor() && isAttribute) {
282282
text = symbol.ContainingType.Name;
283-
if (text.EndsWith("Attribute", StringComparison.Ordinal))
283+
if (text.EndsWith("Attribute", StringComparison.OrdinalIgnoreCase))
284284
text = text.Remove(text.Length - "Attribute".Length);
285285
} else if (symbol.IsKind(SymbolKind.Parameter) && symbol.ContainingSymbol.IsAccessorPropertySet() && ((symbol.IsImplicitlyDeclared && symbol.Name == "Value") || symbol.ContainingSymbol.GetParameters().FirstOrDefault(x => !x.IsImplicitlyDeclared) == symbol)) {
286286
// The case above is basically that if the symbol is a parameter, and the corresponding definition is a property set definition
287287
// AND the first explicitly declared parameter is this symbol, we need to replace it with value.
288288
text = "value";
289-
} else if (text.StartsWith("_", StringComparison.Ordinal) && symbol is IFieldSymbol fieldSymbol && fieldSymbol.AssociatedSymbol?.IsKind(SymbolKind.Property) == true) {
289+
} else if (text.StartsWith("_", StringComparison.OrdinalIgnoreCase) && symbol is IFieldSymbol fieldSymbol && fieldSymbol.AssociatedSymbol?.IsKind(SymbolKind.Property) == true) {
290290
text = fieldSymbol.AssociatedSymbol.Name;
291291
}
292292
}

0 commit comments

Comments
 (0)