Library/PackageCache/com.unity.quicksearch@1.6.0-preview.8/Editor/SearchService.cs
/// <summary>
/// Returns a list of keywords used by auto-completion for the active providers.
/// </summary>
/// <param name="context">Current search context</param>
/// <param name="lastToken">Search token currently being typed.</param>
/// <returns>A list of keywords that can be shown in an auto-complete dropdown.</returns>
Returns a list of keywords used by auto-completion for the active providers.
Returns a list of keywords used by auto - completion for the active providers .
public static string[] GetKeywords(SearchContext context, string lastToken)
        {
            var keywords = new List<string>();
            if (lastToken.StartsWith(k_ActionQueryToken, StringComparison.Ordinal))
            {
                keywords.AddRange(ActionIdToProviders.Keys.Select(k => k_ActionQueryToken + k));
            }
            else
            {
                foreach (var provider in context.providers)
                {
                    try
                    {
                        provider.fetchKeywords?.Invoke(context, lastToken, keywords);
                    }
                    catch (Exception ex)
                    {
                        UnityEngine.Debug.LogError($"Failed to get keywords with {provider.name.displayName}.\r\n{ex}");
                    }
                }
            }
            return keywords.Distinct().ToArray();
        }
public static string [ ] GetKeywords ( SearchContext context , string lastToken ) { var keywords = new List < string > ( ) ; if ( lastToken . StartsWith ( k_ActionQueryToken , StringComparison . Ordinal ) ) { keywords . AddRange ( ActionIdToProviders . Keys . Select ( k => k_ActionQueryToken + k ) ) ; } else { foreach ( var provider in context . providers ) { try { provider . fetchKeywords ? . Invoke ( context , lastToken , keywords ) ; } catch ( Exception ex ) { UnityEngine . Debug . LogError ( $" Failed to get keywords with  { provider . name . displayName } . \r \n { ex } " ) ; } } } return keywords . Distinct ( ) . ToArray ( ) ; }
Returns a list of keywords used by auto-completion for the active providers.
Returns a list of keywords used by auto - completion for the active providers .
A list of keywords that can be shown in an auto-complete dropdown.
A list of keywords that can be shown in an auto - complete dropdown .
context
SearchContext
Current search context
Current search context
lastToken
string
Search token currently being typed.
Search token currently being typed .