refactoring.scm (1308B)
1 ;; Grabs all the local variable declarations. This is useful for scope 2 ;; variable passing. Which variables do we need to pass to the extracted 3 ;; function? 4 ;;((short_var_declaration 5 ;; (expression_list 6 ;; (identifier) @definition.local_name))) 7 ;;((var_declaration 8 ;; (var_spec 9 ;; (identifier) @definition.local_name))) 10 (local_variable_declaration 11 (initialized_variable_definition 12 (identifier) @definiton.local_name)) 13 14 ;; grabs all the arguments that are passed into the function. Needed for 15 ;; function extraction, 106 16 ;;(function_declaration 17 ;; parameters: (parameter_list 18 ;; (parameter_declaration 19 ;; (identifier) @definition.function_argument))) 20 21 (function_signature 22 (formal_parameter_list 23 (formal_parameter 24 (identifier) @definition.function_argument))) 25 26 (function_signature 27 (formal_parameter_list 28 (optional_formal_parameters 29 (formal_parameter 30 (identifier) @definition.function_argument)))) 31 32 ;; TODO is this scope required? Fails when this is uncommented 33 ;; (program) @definition.scope 34 ;;(function_declaration) @definition.scope 35 36 (block) @definition.block 37 38 (declaration) @definition.statement 39 (return_statement) @definition.statement 40 (if_statement) @definition.statement 41 (for_statement) @definition.statement 42 (call_expression) @definition.statement