提交 d871e20a 编写于 作者: C Cyrus Najmabadi

Prefer case sensitive matches over insensitive ones.

上级 b1ba4006
...@@ -34,8 +34,9 @@ public async Task<IEnumerable<SearchResult<ISymbol>>> FindDeclarationsAsync(stri ...@@ -34,8 +34,9 @@ public async Task<IEnumerable<SearchResult<ISymbol>>> FindDeclarationsAsync(stri
if (Exact) if (Exact)
{ {
// Exact matches always have a weight of 0. This way they come before all other matches. // We did an exact, case insensitive, search. Case sensitive matches should
return symbols.Select(s => SearchResult.Create(s.Name, s, weight: 0)).ToList(); // 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 // TODO(cyrusn): It's a shame we have to compute this twice. However, there's no
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册