Microsoft.R.Core.AST.ScopeExtensions.FindVariableDefinitionByName C# (CSharp) Method

FindVariableDefinitionByName() public static method

Locates variable with a given name inside the scope. Only items that appear before the given position are analyzed except when scope is the global scope.
public static FindVariableDefinitionByName ( this scope, string name, int position ) : IVariable
scope this
name string
position int
return IVariable
        public static IVariable FindVariableDefinitionByName(this IScope scope, string name, int position) {
            var variables = scope.GetApplicableVariables(position);
            return variables.FirstOrDefault(x => x.Name.EqualsOrdinal(name));
        }
    }