﻿using System.Collections.Generic;
using System.Linq;
using AbstractCode.Ast.Completion;

namespace AbstractCode.Tests.Completion
{
    public class CodeSuggestionsList
    {
        public CodeSuggestionsList(IList<CodeSuggestion> suggestions)
        {
            Suggestions = suggestions;
        }

        public IList<CodeSuggestion> Suggestions
        {
            get;
        }

        public CodeSuggestion this[int index]
        {
            get { return Suggestions[index]; }
        }

        public bool Contains(string displayText)
        {
            return Suggestions.Any(x => x.DisplayText == displayText);
        }
    }
}