                             if result_regex isnt null
                                 element.type = 'anonymous_function'
                                 list_args = result_regex[2]?.split(',')
-                                element.args = list_args
+                                element.args = []
                                 new_context = DataUtils.deep_copy context
                                 for arg in list_args
                                     arg = arg.replace(/(^\s*)|(\s*$)/gi,"") # Removing leading/trailing spaces
                                     new_context[arg] = true
+                                    element.args.push arg
                                 element.context = new_context
                                 to_skip = result_regex[0].length
                                 body_start = i+result_regex[0].length

                stack: stack
                query: query_before_cursor
                result: result

            if result.suggestions?.length > 0
                for suggestion, i in result.suggestions

                            # Check for a standard method
                            result_regex = @regex.method.exec query.slice new_start
                            if result_regex isnt null
                                result_regex_row = @regex.row.exec query.slice new_start
                                if result_regex_row isnt null
                                    position_opening_parenthesis = result_regex_row[0].indexOf('(')
                                    element.type = 'function' # TODO replace with function
                                    element.name = 'row'
                                    stack.push element
                                    size_stack++
                                    if size_stack > @max_size_stack
                                        return null
                                    element =
                                        type: 'function'
                                        name: '('
                                        position: position+3+1
                                        context: context
                                        complete: 'false'
                                    stack_stop_char = ['(']
                                    start += position_opening_parenthesis
                                    to_skip = result_regex[0].length-1+new_start-i
                                    continue

                                else
                                    if stack[stack.length-1]?.type is 'function' or stack[stack.length-1]?.type is 'var' # We want the query to start with r. or arg.
                                        element.type = 'function'
                                        element.name = result_regex[0]
                                        element.position = position+new_start
                                        start += new_start-i
                                        to_skip = result_regex[0].length-1+new_start-i
                                        stack_stop_char = ['(']
                                        continue
                                    else
                                        position_opening_parenthesis = result_regex[0].indexOf('(')
                                        if position_opening_parenthesis isnt -1 and result_regex[0].slice(0, position_opening_parenthesis) of context
                                            # Save the var
                                            element.real_type = @types.value
                                            element.type = 'var'
                                            element.name = result_regex[0].slice(0, position_opening_parenthesis)
                                            stack.push element
                                            size_stack++
                                            if size_stack > @max_size_stack
                                                return null
                                            element =
                                                type: 'function'
                                                name: '('
                                                position: position+position_opening_parenthesis+1
                                                context: context
                                                complete: 'false'
                                            stack_stop_char = ['(']
                                            start = position_opening_parenthesis
                                            to_skip = result_regex[0].length-1
                                            continue
                                        ###
                                        # This last condition is a special case for r(expr)
                                        else if position_opening_parenthesis isnt -1 and result_regex[0].slice(0, position_opening_parenthesis) is 'r'
                                            element.type = 'var'
                                            element.name = 'r'
                                            element.real_type = @types.value
                                            element.position = position+new_start
                                            start += new_start-i
                                            to_skip = result_regex[0].length-1+new_start-i
                                            stack_stop_char = ['(']
                                            continue
                                        ###


                            # Check for method without parenthesis r., r.row., doc.
                            result_regex = @regex.method_var.exec query.slice new_start
                            if result_regex isnt null
                                if result_regex[0].slice(0, result_regex[0].length-1) of context
                                    element.type = 'var'
                                    element.real_type = @types.value
                                else
                                    element.type = 'function'
                                element.position = position+new_start
                                element.name = result_regex[0].slice(0, result_regex[0].length-1).replace(/\s/, '')
                                element.complete = true
                                to_skip = element.name.length-1+new_start-i
                                stack.push element
