Class SymbolSearch
- Namespace
- RDCore.SDK.Semantics.Refactoring
- Assembly
- RDCore.SDK.dll
Searches symbols by name (LSP 3.17 §Workspace Symbols Request): a name matches what a client asks when it has each character of it, in order, and the closer the match, the earlier the name (SymbolMatch).
public static class SymbolSearch
- Inheritance
-
SymbolSearch
- Inherited Members
Methods
Match(string, string)
How a name matches a query.
public static SymbolMatch? Match(string query, string name)
Parameters
querystringWhat is asked: a whole name, the start of one, or some of its characters, in order.
namestringThe name.
Returns
- SymbolMatch?
How it matches; null when it does not. Every name matches an empty query exactly.
Search<T>(string, IEnumerable<T>, Func<T, string>, int)
The candidates that match a query, the closest matches first.
public static IReadOnlyList<T> Search<T>(string query, IEnumerable<T> candidates, Func<T, string> nameOf, int limit)
Parameters
querystringWhat is asked (Match(string, string)).
candidatesIEnumerable<T>The candidates.
nameOfFunc<T, string>The name of a candidate.
limitintHow many to answer at most: a client asks again as its user types.
Returns
- IReadOnlyList<T>
The candidates that match, by how close the match is, then by name.
Type Parameters
T