public CrawledIndexCompletionProvider(CrawledIndex index)
        {
            _orgs = new SortedSet <string>(
                index.Repos.Select(r => r.Org),
                StringComparer.OrdinalIgnoreCase
                ).ToArray();

            _repos = new SortedSet <string>(
                index.Repos.SelectMany(r => new[] { r.Name, r.FullName }),
                StringComparer.OrdinalIgnoreCase
                ).ToArray();

            _users = new SortedSet <string>(
                index.Repos.SelectMany(r => r.Issues.Values)
                .SelectMany(i => new[] { i.CreatedBy }.Concat(i.Assignees)),
                StringComparer.OrdinalIgnoreCase
                ).ToArray();

            _labels = new SortedSet <string>(
                index.Repos.SelectMany(r => r.Labels)
                .Select(l => l.Name),
                StringComparer.OrdinalIgnoreCase
                ).ToArray();

            _milestones = new SortedSet <string>(
                index.Repos.SelectMany(r => r.Milestones)
                .Select(m => m.Title),
                StringComparer.OrdinalIgnoreCase
                ).ToArray();

            _areaPaths = new SortedSet <string>(
                index.Repos.SelectMany(r => r.Labels)
                .SelectMany(l => TextTokenizer.GetAreaPaths(l.Name)),
                StringComparer.OrdinalIgnoreCase
                ).ToArray();

            _areaNodes = new SortedSet <string>(
                index.Repos.SelectMany(r => r.Labels)
                .SelectMany(l => TextTokenizer.GetAreaPaths(l.Name, segmentsOnly: true)),
                StringComparer.OrdinalIgnoreCase
                ).ToArray();
        }