@@ -66,67 +66,67 @@ public class NamedArgumentsAnalyzer : DiagnosticAnalyzer
6666 // Common methods to exclude by default (in addition to user-specified ones)
6767 private readonly HashSet < string > DefaultExcludedMethods = new HashSet < string >
6868 {
69- "System.Char .Equals" ,
70- "System.Char .CompareTo" ,
71- "System.Char .GetUnicodeCategory" ,
72- "System.Char .IsControl" ,
73- "System.Char .IsDigit" ,
74- "System.Char .IsLetter" ,
75- "System.Char .IsLetterOrDigit" ,
76- "System.Char .IsLower" ,
77- "System.Char .IsNumber" ,
78- "System.Char .IsPunctuation" ,
79- "System.Char .IsSeparator" ,
80- "System.Char .IsSurrogate" ,
81- "System.Char .IsSymbol" ,
82- "System.Char .IsUpper" ,
83- "System.Char .IsWhiteSpace" ,
84- "System.Char .ToLower" ,
85- "System.Char .ToLowerInvariant" ,
86- "System.Char .ToUpper" ,
87- "System.Char .ToUpperInvariant" ,
88- "System.Char .GetNumericValue" ,
89- "System.String .Contains" ,
90- "System.String .EndsWith" ,
91- "System.String .StartsWith" ,
92- "System.String .Equals" ,
93- "System.String .IndexOf" ,
94- "System.String .LastIndexOf" ,
95- "System.String .Replace" ,
96- "System.String .Split" ,
97- "System.String .Trim" ,
98- "System.String .TrimStart" ,
99- "System.String .TrimEnd" ,
100- "System.String .Insert" ,
101- "System.String .Remove" ,
102- "System.String .Substring" ,
103- "System.String .IsNullOrEmpty" ,
104- "System.String .IsNullOrWhiteSpace" ,
105- "System.Text. StringBuilder.Append" ,
106- "System.Text. StringBuilder.AppendLine" ,
107- "System.Text. StringBuilder.Insert" ,
108- "System.Text. StringBuilder.Replace" ,
109- "System.Text. StringBuilder.Remove" ,
110- "System.Globalization. CharUnicodeInfo.GetUnicodeCategory" ,
111- "System.Globalization. CharUnicodeInfo.GetDigitValue" ,
112- "System.Globalization. CharUnicodeInfo.GetNumericValue" ,
113- "System.Linq. Enumerable.Where" ,
114- "System.Linq. Enumerable.Select" ,
115- "System.Linq. Enumerable.FirstOrDefault" ,
116- "System.Linq. Enumerable.First" ,
117- "System.Linq. Enumerable.Any" ,
118- "System.Linq. Enumerable.OrderBy" ,
119- "System.Linq. Enumerable.OrderByDescending" ,
120- "System.Linq. Enumerable.GroupBy" ,
121- "System.Linq. Enumerable.ToList" ,
122- "System.Linq. Enumerable.ToArray" ,
123- "System.Linq. Enumerable.Contains" ,
124- "System.Linq. Enumerable.ElementAt" ,
125- "System.Linq. Enumerable.ElementAtOrDefault" ,
126- "System.Linq. Enumerable.All" ,
127- "System.Linq. Enumerable.Count" ,
128- "System.Linq. Enumerable.Last" ,
129- "System.Linq. Enumerable.LastOrDefault"
69+ "char .Equals" ,
70+ "char .CompareTo" ,
71+ "char .GetUnicodeCategory" ,
72+ "char .IsControl" ,
73+ "char .IsDigit" ,
74+ "char .IsLetter" ,
75+ "char .IsLetterOrDigit" ,
76+ "char .IsLower" ,
77+ "char .IsNumber" ,
78+ "char .IsPunctuation" ,
79+ "char .IsSeparator" ,
80+ "char .IsSurrogate" ,
81+ "char .IsSymbol" ,
82+ "char .IsUpper" ,
83+ "char .IsWhiteSpace" ,
84+ "char .ToLower" ,
85+ "char .ToLowerInvariant" ,
86+ "char .ToUpper" ,
87+ "char .ToUpperInvariant" ,
88+ "char .GetNumericValue" ,
89+ "string .Contains" ,
90+ "string .EndsWith" ,
91+ "string .StartsWith" ,
92+ "string .Equals" ,
93+ "string .IndexOf" ,
94+ "string .LastIndexOf" ,
95+ "string .Replace" ,
96+ "string .Split" ,
97+ "string .Trim" ,
98+ "string .TrimStart" ,
99+ "string .TrimEnd" ,
100+ "string .Insert" ,
101+ "string .Remove" ,
102+ "string .Substring" ,
103+ "string .IsNullOrEmpty" ,
104+ "string .IsNullOrWhiteSpace" ,
105+ "StringBuilder.Append" ,
106+ "StringBuilder.AppendLine" ,
107+ "StringBuilder.Insert" ,
108+ "StringBuilder.Replace" ,
109+ "StringBuilder.Remove" ,
110+ "CharUnicodeInfo.GetUnicodeCategory" ,
111+ "CharUnicodeInfo.GetDigitValue" ,
112+ "CharUnicodeInfo.GetNumericValue" ,
113+ "Enumerable.Where" ,
114+ "Enumerable.Select" ,
115+ "Enumerable.FirstOrDefault" ,
116+ "Enumerable.First" ,
117+ "Enumerable.Any" ,
118+ "Enumerable.OrderBy" ,
119+ "Enumerable.OrderByDescending" ,
120+ "Enumerable.GroupBy" ,
121+ "Enumerable.ToList" ,
122+ "Enumerable.ToArray" ,
123+ "Enumerable.Contains" ,
124+ "Enumerable.ElementAt" ,
125+ "Enumerable.ElementAtOrDefault" ,
126+ "Enumerable.All" ,
127+ "Enumerable.Count" ,
128+ "Enumerable.Last" ,
129+ "Enumerable.LastOrDefault"
130130
131131
132132
@@ -455,13 +455,7 @@ private static string GetFullMethodName(IMethodSymbol methodSymbol)
455455 private static string GetFullTypeName ( INamedTypeSymbol typeSymbol )
456456 {
457457 if ( typeSymbol == null ) return string . Empty ;
458- var full = typeSymbol . ToDisplayString ( SymbolDisplayFormat . FullyQualifiedFormat ) ;
459- // strip global:: prefix if present
460- const string GlobalPrefix = "global::" ;
461- if ( full . StartsWith ( GlobalPrefix , StringComparison . Ordinal ) )
462- {
463- full = full . Substring ( GlobalPrefix . Length ) ;
464- }
458+ var full = typeSymbol . ToDisplayString ( SymbolDisplayFormat . MinimallyQualifiedFormat ) ;
465459 return full ;
466460 }
467461 }
0 commit comments