diff options
| author | winwisely268 <winwisely268@gmail.com> | 2020-07-17 15:49:43 +0000 |
|---|---|---|
| committer | Thomas Vigouroux <39092278+vigoux@users.noreply.github.com> | 2020-07-17 20:44:43 +0200 |
| commit | 59c084b5d837165328da0fe19a8155f95673ee51 (patch) | |
| tree | f855574e6ce01cf7467ca3b6ca161f7e10df3dbf /queries/go | |
| parent | fix(highlights): add array strings (diff) | |
| download | nvim-treesitter-59c084b5d837165328da0fe19a8155f95673ee51.tar nvim-treesitter-59c084b5d837165328da0fe19a8155f95673ee51.tar.gz nvim-treesitter-59c084b5d837165328da0fe19a8155f95673ee51.tar.bz2 nvim-treesitter-59c084b5d837165328da0fe19a8155f95673ee51.tar.lz nvim-treesitter-59c084b5d837165328da0fe19a8155f95673ee51.tar.xz nvim-treesitter-59c084b5d837165328da0fe19a8155f95673ee51.tar.zst nvim-treesitter-59c084b5d837165328da0fe19a8155f95673ee51.zip | |
go loop and func literal, rust textobject support
Diffstat (limited to 'queries/go')
| -rw-r--r-- | queries/go/textobjects.scm | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/queries/go/textobjects.scm b/queries/go/textobjects.scm index 61b968f3b..0bc56f1df 100644 --- a/queries/go/textobjects.scm +++ b/queries/go/textobjects.scm @@ -2,6 +2,10 @@ (function_declaration body: (block)? @function.inner) @function.outer +;; function literals +(func_literal + (_)? @function.inner) @function.outer + ;; method as function textobject (method_declaration body: (block)? @function.inner) @function.outer @@ -14,8 +18,8 @@ (type_spec (type_identifier) (interface_type (method_spec_list (_)?) @class.inner))) @class.outer ;; struct literals as class textobject -(composite_literal - (type_identifier)? +(composite_literal + (type_identifier)? (struct_type (_))? (literal_value (_)) @class.inner) @class.outer @@ -29,9 +33,18 @@ (if_statement condition: (_) @conditional.inner) +;; loops +(for_statement + body: (block)? @loop.inner) @loop.outer + ;; blocks (_ (block) @block.inner) @block.outer + ;; statements (block (_) @statement.outer) + ;; comments (comment) @comment.outer + +;; calls +(call_expression (_)? @call.inner) @call.outer |
