Microsoft.R.Core.AST.AstRootExtensions.GetFunctionsFromPosition C# (CSharp) Method

GetFunctionsFromPosition() public static method

Enumerates function definitions applicable to the current scope. Returns definitions that appear in the file up to the specified position.
public static GetFunctionsFromPosition ( this ast, int position ) : IEnumerable
ast this
position int
return IEnumerable
        public static IEnumerable<RFunction> GetFunctionsFromPosition(this AstRoot ast, int position) {
            var scope = ast.GetNodeOfTypeFromPosition<IScope>(position);
            var variables = scope.GetApplicableVariables(position);
            return variables.Where(x => x.Value is RFunction).Select(x => x.Value as RFunction);
        }