public IList <IntellisenseProviderResult> GetIntellisenseResults(IntellisenseProviderContext context)
        {
            if (context == null)
            {
                return(new List <IntellisenseProviderResult>());
            }

            var results = new List <IntellisenseProviderResult>();

            if (context.DesiredResultSet == IntellisenseDesiredResultSet.EntireSet)
            {
                IntellisenseResults.Clear();
                FileSystemQuery.QueryList("");
                FileSystemQuery.QueryCollection.ForEach(s => IntellisenseResults.Add(new IntellisenseProviderResult(this, s, string.Empty, string.Empty, false)));
                results.AddRange(IntellisenseResults);
            }
            else
            {
                if (!InLiteralRegion(context.InputText, context.CaretPosition))
                {
                    IntellisenseResults.Clear();
                    var regions    = context.InputText.Split(' ');
                    var sum        = 0;
                    var searchText = regions.Select(a => new { a, a.Length }).TakeWhile(a =>
                    {
                        sum = sum + context.CaretPosition;
                        return(sum >= context.CaretPosition);
                    }).Last().a;
                    FileSystemQuery.QueryList(searchText);
                    FileSystemQuery.QueryCollection.ForEach(s => IntellisenseResults.Add(new IntellisenseProviderResult(this, s, string.Empty, string.Empty, false)));
                    results.AddRange(IntellisenseResults);
                }
            }
            return(results);
        }
        public IList <IIntellisenseResult> GetIntellisenseResultsImpl(IntellisenseProviderContext context)
        {
            string searchText = context.FindTextToSearch();
            var    results    = new List <IIntellisenseResult>();

            if (context.DesiredResultSet == IntellisenseDesiredResultSet.EntireSet)
            {
                results.AddRange(IntellisenseResults);
            }
            else if (!InLiteralRegion(context.InputText, context.CaretPosition))
            {
                var filteredResults = IntellisenseResults.Where(i => i.Option.DisplayValue.ToLower().StartsWith(searchText.ToLower()));
                results.AddRange(filteredResults);
            }
            return(results);
        }