From d871e20a2374b36f48e97431da21b8e0b1700dbb Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Sat, 5 Dec 2015 13:13:19 -0800 Subject: [PATCH] Prefer case sensitive matches over insensitive ones. --- .../AbstractAddImportCodeFixProvider.SearchScope.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Features/Core/Portable/CodeFixes/AddImport/AbstractAddImportCodeFixProvider.SearchScope.cs b/src/Features/Core/Portable/CodeFixes/AddImport/AbstractAddImportCodeFixProvider.SearchScope.cs index 59cf278be43..5eb2785b115 100644 --- a/src/Features/Core/Portable/CodeFixes/AddImport/AbstractAddImportCodeFixProvider.SearchScope.cs +++ b/src/Features/Core/Portable/CodeFixes/AddImport/AbstractAddImportCodeFixProvider.SearchScope.cs @@ -34,8 +34,9 @@ public async Task>> FindDeclarationsAsync(stri if (Exact) { - // Exact matches always have a weight of 0. This way they come before all other matches. - return symbols.Select(s => SearchResult.Create(s.Name, s, weight: 0)).ToList(); + // We did an exact, case insensitive, search. Case sensitive matches should + // be preffered though over insensitive ones. + return symbols.Select(s => SearchResult.Create(s.Name, s, weight: s.Name == name ? 0 : 1)).ToList(); } // TODO(cyrusn): It's a shame we have to compute this twice. However, there's no -- GitLab