helix-mods/runtime/queries/go
Daniel Martí e7f25d88ca
Avoid extra indentation on Go switches (#6817)
Unlike other languages, in Go, switches themselves are not indented;
it's just each case body which is indented by one level:

   switch foo {
   case "bar":
      baz()
   }

As such, we shouldn't `@indent` for type_switch_statement nor
expression_switch_statement, as otherwise inserted lines show up as:

   switch foo {
      // inserted with "o"
   case "bar":
         // inserted with "o"
      baz()
   }

With the fix, the inserted lines are indented properly:

   switch foo {
   // inserted with "o"
   case "bar":
      // inserted with "o"
      baz()
   }

I also verified that indentation on selects similarly works well.

Thanks to Triton171 for helping with this fix.
2023-04-25 18:05:23 -05:00
..
highlights.scm Update highlights for golang (#6204) 2023-03-07 18:33:13 -06:00
indents.scm Avoid extra indentation on Go switches (#6817) 2023-04-25 18:05:23 -05:00
injections.scm tree sitter comments injections (#1527) 2022-01-21 00:50:06 +09:00
locals.scm Fix go locals query for var_spec identifiers 2023-04-16 18:32:00 +02:00
tags.scm Add tree-sitter queries. 2021-04-09 18:57:46 +09:00
textobjects.scm add test textobjects queries for erlang,gleam,go,python,rust 2022-06-21 11:32:03 -05:00