static IEnumerable <SearchItem> FetchItems(SearchContext context, SearchProvider provider)
        {
            if (string.IsNullOrEmpty(context.searchQuery))
            {
                yield break;
            }

            {
                var options = FindOptions.Words | FindOptions.Regex | FindOptions.Glob;
                if (context.wantsMore)
                {
                    options |= FindOptions.Fuzzy;
                }
                if (context.options.HasAny(SearchFlags.Packages))
                {
                    options |= FindOptions.Packages;
                }

                foreach (var e in Search(context, provider, options))
                {
                    if (!e.valid)
                    {
                        yield return(null);
                    }
                    else
                    {
                        yield return(AssetProvider.CreateItem("Files", context, provider, null, e.source, e.score, e.flags));
                    }
                }
            }
        }
Example #2
0
        static IEnumerable <SearchItem> FetchItems(SearchContext context, SearchProvider provider)
        {
            var options = FindOptions.Words | FindOptions.Regex | FindOptions.Glob;

            if (context.wantsMore)
            {
                options |= FindOptions.Packages | FindOptions.Fuzzy;
            }

            foreach (var e in Search(context, provider, options))
            {
                yield return(AssetProvider.CreateItem("Files", context, provider, null, e.source, e.score, e.flags));
            }
        }