Ejemplo n.º 1
0
        private IEnumerable <Suggestion> GetCompletions(string text)
        {
            var completions = _cSharpEvaluator.GetCompletions(text).OrderBy(c => c.Text);

            if (completions.Any())
            {
                return(completions);
            }

            if (_syntaxProvider.IsPropertyIndicator(text.Last()))
            {
                var word = GetWord(text);
                var obj  = _syntaxProvider.GetType(word);
                if (obj != null)
                {
                    var suggestions = obj.Columns
                                      .OrderBy(p => p.Name)
                                      .Select(property => new Suggestion(property.Name));
                    return(suggestions);
                }
            }
            return(Enumerable.Empty <Suggestion>());
        }