diff --git a/queries/tact/textobjects.scm b/queries/tact/textobjects.scm index 328af9a0..cdc47440 100644 --- a/queries/tact/textobjects.scm +++ b/queries/tact/textobjects.scm @@ -1,6 +1,21 @@ ; See: https://github.com/nvim-treesitter/nvim-treesitter-textobjects#built-in-textobjects ; function.inner & outer ; ---------------------- +; asm +(asm_function + body: (_)) @function.outer + +(asm_function + body: (asm_function_body + . + "{" + . + (_) @_start + (_)? @_end + . + "}") + (#make-range! "function.inner" @_start @_end)) + ; global (global_function body: (_)) @function.outer @@ -256,6 +271,9 @@ (_ (block_statement) @block.inner) @block.outer +(_ + (asm_list) @block.inner) @block.outer + ; call.inner & outer ; ------------------ (method_call_expression) @call.outer @@ -366,6 +384,21 @@ ","? @_end (#make-range! "parameter.outer" @parameter.inner @_end)) +; second and following +(destruct_bind_list + "," @_start + . + (_) @parameter.inner + (#make-range! "parameter.outer" @_start @parameter.inner)) + +; first +(destruct_bind_list + . + (_) @parameter.inner + . + ","? @_end + (#make-range! "parameter.outer" @parameter.inner @_end)) + ; single parameter (receive_function parameter: (_) @parameter.inner @parameter.outer)