Пример #1
0
        /// <summary>
        /// Gets the list of possible completions at the given position.
        /// </summary>
        /// <param name="statements">The statements.</param>
        /// <param name="position">The position to look for completions.</param>
        /// <param name="symbols">The existing global symbols.</param>
        /// <returns>The list of completions for the given position.</returns>
        public static IEnumerable <String> GetCompletionAt(this IEnumerable <IStatement> statements, TextPosition position, IEnumerable <String> symbols)
        {
            var walker = new CompletionTreeWalker(position, symbols);

            statements.ToBlock().Accept(walker);
            return(walker.Suggestions);
        }
        /// <summary>
        /// Gets the list of possible completions at the given position.
        /// </summary>
        /// <param name="statements">The statements.</param>
        /// <param name="position">The position to look for completions.</param>
        /// <param name="symbols">The existing global symbols.</param>
        /// <returns>The list of completions for the given position.</returns>
        public static IEnumerable <String> GetCompletionAt(this IEnumerable <IStatement> statements, TextPosition position, IDictionary <String, Object> symbols)
        {
            var walker = new CompletionTreeWalker(position, symbols);

            walker.FindSuggestions(statements);
            return(walker.Suggestions);
        }